From 0061dedaae41b117115bab4bd00e9dddb85bbe66 Mon Sep 17 00:00:00 2001 From: Sylvain Munaut Date: Tue, 18 Oct 2011 20:11:03 +0200 Subject: [PATCH] timer: Simplify osmo_timers_nearest even more Signed-off-by: Sylvain Munaut --- src/timer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/timer.c b/src/timer.c index d1a4e7e0d..da16459c2 100644 --- a/src/timer.c +++ b/src/timer.c @@ -132,10 +132,10 @@ int osmo_timer_pending(struct osmo_timer_list *timer) */ struct timeval *osmo_timers_nearest(void) { - if (nearest_p != NULL) - return nearest_p; - else - return NULL; + /* nearest_p is exactly what we need already: NULL if nothing is + * waiting, {0,0} if we must dispatch immediately, and the correct + * delay if we need to wait */ + return nearest_p; } static void update_nearest(struct timeval *cand, struct timeval *current)