]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virsh: domain: remove else branch
authorKristina Hanicova <khanicov@redhat.com>
Fri, 24 Sep 2021 15:17:50 +0000 (17:17 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Sat, 25 Sep 2021 07:30:53 +0000 (09:30 +0200)
I removed else branches after return/break as they are not
necessary and the code looks cleaner without them.

Signed-off-by: Kristina Hanicova <khanicov@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
tools/virsh-domain.c

index 5e4eebda4e85c82a5353783ccc8dffe4322f1914..0b78fbf7280ff5fb73f7675744e13dc9b52ff5cd 100644 (file)
@@ -11040,12 +11040,12 @@ cmdMigrateCompCache(vshControl *ctl, const vshCmd *cmd)
         return false;
 
     rc = vshCommandOptULongLong(ctl, cmd, "size", &size);
-    if (rc < 0) {
+    if (rc < 0)
+        return false;
+
+    if (rc != 0 &&
+        (virDomainMigrateSetCompressionCache(dom, size, 0) < 0))
         return false;
-    } else if (rc != 0) {
-        if (virDomainMigrateSetCompressionCache(dom, size, 0) < 0)
-            return false;
-    }
 
     if (virDomainMigrateGetCompressionCache(dom, &size, 0) < 0)
         return false;
@@ -11426,11 +11426,9 @@ cmdDomDisplay(vshControl *ctl, const vshCmd *cmd)
 
         /* We got what we came for so return successfully */
         ret = true;
-        if (!all) {
+        if (!all)
             break;
-        } else {
-            vshPrint(ctl, "\n");
-        }
+        vshPrint(ctl, "\n");
     }
 
     if (!ret) {