From: David Tardon Date: Thu, 16 May 2019 14:10:10 +0000 (+0200) Subject: timer: simplify computation of unit activation time X-Git-Tag: v243-rc1~413 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=525b95f10edf74ef8eca9773ab9015d9723c9365;p=thirdparty%2Fsystemd.git timer: simplify computation of unit activation time --- diff --git a/src/core/timer.c b/src/core/timer.c index 8440bb27ba8..ba74dc7aea3 100644 --- a/src/core/timer.c +++ b/src/core/timer.c @@ -430,28 +430,16 @@ static void timer_enter_waiting(Timer *t, bool time_change) { case TIMER_UNIT_ACTIVE: leave_around = true; - base = trigger->inactive_exit_timestamp.monotonic; - - if (base <= 0) - base = t->last_trigger.monotonic; - + base = MAX(trigger->inactive_exit_timestamp.monotonic, t->last_trigger.monotonic); if (base <= 0) continue; - base = MAX(base, t->last_trigger.monotonic); - break; case TIMER_UNIT_INACTIVE: leave_around = true; - base = trigger->inactive_enter_timestamp.monotonic; - - if (base <= 0) - base = t->last_trigger.monotonic; - + base = MAX(trigger->inactive_enter_timestamp.monotonic, t->last_trigger.monotonic); if (base <= 0) continue; - base = MAX(base, t->last_trigger.monotonic); - break; default: