From: Ján Tomko Date: Fri, 1 Apr 2022 13:11:01 +0000 (+0200) Subject: tools: snapshot: remove pointless checks X-Git-Tag: v8.3.0-rc1~143 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f8ae0353fcdc5d403b15f824ae40a826d4b13fc;p=thirdparty%2Flibvirt.git tools: snapshot: remove pointless checks 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 --- 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)) {