core: introduce a helper function to wrap unit_log_{success,failure}
It's inline so that the compiler can easily optimize away the call to get status string.
This commit is contained in:
+1
-5
@@ -288,11 +288,7 @@ static void timer_enter_dead(Timer *t, TimerResult f) {
|
||||
if (t->result == TIMER_SUCCESS)
|
||||
t->result = f;
|
||||
|
||||
if (t->result == TIMER_SUCCESS)
|
||||
unit_log_success(UNIT(t));
|
||||
else
|
||||
unit_log_failure(UNIT(t), timer_result_to_string(t->result));
|
||||
|
||||
unit_log_result(UNIT(t), t->result == TIMER_SUCCESS, timer_result_to_string(t->result));
|
||||
timer_set_state(t, t->result != TIMER_SUCCESS ? TIMER_FAILED : TIMER_DEAD);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user