From ef3fc326b9cb080134916683b5ad7095d9e3db13 Mon Sep 17 00:00:00 2001 From: Zbigniew Jędrzejewski-Szmek Date: Sat, 30 Jan 2021 17:27:45 +0100 Subject: manager: remove unnecessary conditional --- src/core/manager.c | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/core/manager.c b/src/core/manager.c index c7cd1fbc6d..ee28bf4e98 100644 --- a/src/core/manager.c +++ b/src/core/manager.c @@ -1188,18 +1188,15 @@ static void unit_gc_sweep(Unit *u, unsigned gc_marker) { is_bad = false; } - if (u->refs_by_target) { - const UnitRef *ref; + const UnitRef *ref; + LIST_FOREACH(refs_by_target, ref, u->refs_by_target) { + unit_gc_sweep(ref->source, gc_marker); - LIST_FOREACH(refs_by_target, ref, u->refs_by_target) { - unit_gc_sweep(ref->source, gc_marker); - - if (ref->source->gc_marker == gc_marker + GC_OFFSET_GOOD) - goto good; + if (ref->source->gc_marker == gc_marker + GC_OFFSET_GOOD) + goto good; - if (ref->source->gc_marker != gc_marker + GC_OFFSET_BAD) - is_bad = false; - } + if (ref->source->gc_marker != gc_marker + GC_OFFSET_BAD) + is_bad = false; } if (is_bad) -- cgit v1.2.3