Skip to content

Commit

Permalink
manager: reformat boolean expression in unit_is_pristine()
Browse files Browse the repository at this point in the history
Not not IN_SET(…) is just too much for my poor brain. Let's invert
the expression to make it easier to undertand.

(cherry picked from commit b146a7345b69de16e88347acadb3783ffeeaad9d)

Related: #2156620
  • Loading branch information
keszybz authored and dtardon committed Jul 13, 2023
1 parent a175e11 commit ccbf58f
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/unit.c
Original file line number Diff line number Diff line change
Expand Up @@ -4848,12 +4848,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) {
Expand Down

0 comments on commit ccbf58f

Please sign in to comment.