From 3742095b27f8df4b195d530b52d15bc5fea70bf1 Mon Sep 17 00:00:00 2001 From: Andreas Rammhold Date: Fri, 29 Sep 2017 00:37:23 +0200 Subject: tree-wide: use IN_SET where possible In addition to the changes from #6933 this handles cases that could be matched with the included cocci file. --- src/core/job.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/core/job.c') diff --git a/src/core/job.c b/src/core/job.c index f04c8a2168..f962881a12 100644 --- a/src/core/job.c +++ b/src/core/job.c @@ -368,19 +368,13 @@ bool job_type_is_redundant(JobType a, UnitActiveState b) { switch (a) { case JOB_START: - return - b == UNIT_ACTIVE || - b == UNIT_RELOADING; + return IN_SET(b, UNIT_ACTIVE, UNIT_RELOADING); case JOB_STOP: - return - b == UNIT_INACTIVE || - b == UNIT_FAILED; + return IN_SET(b, UNIT_INACTIVE, UNIT_FAILED); case JOB_VERIFY_ACTIVE: - return - b == UNIT_ACTIVE || - b == UNIT_RELOADING; + return IN_SET(b, UNIT_ACTIVE, UNIT_RELOADING); case JOB_RELOAD: return @@ -888,7 +882,7 @@ int job_finish_and_invalidate(Job *j, JobResult result, bool recursive, bool alr goto finish; } - if (result == JOB_FAILED || result == JOB_INVALID) + if (IN_SET(result, JOB_FAILED, JOB_INVALID)) j->manager->n_failed_jobs++; job_uninstall(j); -- cgit v1.2.3