From 49d74124a55fac3b2ed9574b7642887c1da49f0b Mon Sep 17 00:00:00 2001 From: Kristina Hanicova Date: Fri, 24 Sep 2021 17:17:50 +0200 Subject: [PATCH] virsh: domain: remove else branch I removed else branches after return/break as they are not necessary and the code looks cleaner without them. Signed-off-by: Kristina Hanicova Reviewed-by: Michal Privoznik --- tools/virsh-domain.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c index 5e4eebda4e..0b78fbf728 100644 --- a/tools/virsh-domain.c +++ b/tools/virsh-domain.c @@ -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) {