]> xenbits.xensource.com Git - libvirt.git/commitdiff
tools: snapshot: remove pointless checks
authorJán Tomko <jtomko@redhat.com>
Fri, 1 Apr 2022 13:11:01 +0000 (15:11 +0200)
committerJán Tomko <jtomko@redhat.com>
Thu, 7 Apr 2022 10:02:31 +0000 (12:02 +0200)
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 <jtomko@redhat.com>
Reviewed-by: Andrea Bolognani <abologna@redhat.com>
tools/virsh-snapshot.c

index 9ed64313afdb4ee87fae63340c296b7f038e0470..7cd76f39e2eb9a6d1dc38a2f608ad1bf0f2652f2 100644 (file)
@@ -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)) {