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.
  • Loading branch information
keszybz committed Oct 14, 2022
1 parent 52bcf45 commit b146a73
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 @@ -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) {
Expand Down

0 comments on commit b146a73

Please sign in to comment.