return now if we found a task that is ready (optimization)
authorlurchi <lurchi@strangeplace.net>
Tue, 16 Jan 2018 17:44:58 +0000 (18:44 +0100)
committerlurchi <lurchi@strangeplace.net>
Tue, 16 Jan 2018 17:44:58 +0000 (18:44 +0100)
src/util/scheduler.c

index a14d4f1d7292fc01699d78e75df7acb63bcfd76a..0e7a16275ddffe951df6c7a0d843f9cfe6ec562f 100644 (file)
@@ -424,7 +424,7 @@ get_timeout ()
   {
     if (0 != pos->reason)
     {
-      timeout = now;
+      return now;
     }
     else
     {
@@ -435,7 +435,7 @@ get_timeout ()
   {
     if (0 != pos->reason)
     {
-      timeout = now;
+      return now;
     }
     else if ((pos->timeout.abs_value_us != GNUNET_TIME_UNIT_FOREVER_ABS.abs_value_us) &&
              (timeout.abs_value_us > pos->timeout.abs_value_us))