From 4f8ae0353fcdc5d403b15f824ae40a826d4b13fc Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A1n=20Tomko?= Date: Fri, 1 Apr 2022 15:11:01 +0200 Subject: [PATCH] tools: snapshot: remove pointless checks MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit There's no need to check whether a flag is not set just to set it in that case. Signed-off-by: Ján Tomko Reviewed-by: Andrea Bolognani --- tools/virsh-snapshot.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/tools/virsh-snapshot.c b/tools/virsh-snapshot.c index 9ed64313af..7cd76f39e2 100644 --- a/tools/virsh-snapshot.c +++ b/tools/virsh-snapshot.c @@ -1292,10 +1292,9 @@ virshSnapshotListCollect(vshControl *ctl, virDomainPtr dom, if (filter_fallback) { /* Older API didn't filter on status or location, but the * information is available in domain XML. */ - if (!(orig_flags & VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS)) - orig_flags |= VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS; - if (!(orig_flags & VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION)) - orig_flags |= VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION; + orig_flags |= VIR_DOMAIN_SNAPSHOT_FILTERS_STATUS; + orig_flags |= VIR_DOMAIN_SNAPSHOT_FILTERS_LOCATION; + for (i = 0; i < snaplist->nsnaps; i++) { switch (virshSnapshotFilter(ctl, snaplist->snaps[i].snap, orig_flags)) { -- 2.47.3