timer: Simplify osmo_timers_nearest even more
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
diff --git a/src/timer.c b/src/timer.c
index d1a4e7e..da16459 100644
--- a/src/timer.c
+++ b/src/timer.c
@@ -132,10 +132,10 @@
*/
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)