]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
manager: reformat boolean expression in unit_is_pristine()
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 14 Oct 2022 12:40:24 +0000 (14:40 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Fri, 14 Oct 2022 13:13:57 +0000 (15:13 +0200)
Not not IN_SET(…) is just too much for my poor brain. Let's invert
the expression to make it easier to undertand.

src/core/unit.c

index d6bea2080f089f329eee16c06d44e64b7827401f..5016114cb470b9d68651c1750063f7ea760a1997 100644 (file)
@@ -4850,12 +4850,12 @@ bool unit_is_pristine(Unit *u) {
          * are marked UNIT_LOADED even though nothing was actually
          * loaded, as those unit types don't require a file on disk. */
 
-        return !(!IN_SET(u->load_state, UNIT_NOT_FOUND, UNIT_LOADED) ||
-                 u->fragment_path ||
-                 u->source_path ||
-                 !strv_isempty(u->dropin_paths) ||
-                 u->job ||
-                 u->merged_into);
+        return IN_SET(u->load_state, UNIT_NOT_FOUND, UNIT_LOADED) &&
+               !u->fragment_path &&
+               !u->source_path &&
+               strv_isempty(u->dropin_paths) &&
+               !u->job &&
+               !u->merged_into;
 }
 
 pid_t unit_control_pid(Unit *u) {