On Thu, Sep 23, 2021 at 17:08:02 +0200, Kristina Hanicova wrote:
This patch changes the way functions return bool value from
pattern:
if (functionCall() < 0)
return false;
return true;
into a more readable and modern way of direct return:
return functionCall() == 0;
I know that not everybody will agree this is more readable so I
am open to discussion and I leave merging this patch up to the
reviewer.
I agree that this is a matter of taste. My main counter-argument is that
in case you need to add more code after what was the last
'functionCall', you then need to undo the pattern you've added. So in
effort to minimize churn IMO the existing approach is better.
Signed-off-by: Kristina Hanicova <khanicov(a)redhat.com>
---
tools/virsh-domain.c | 114 ++++++++++---------------------------------
1 file changed, 26 insertions(+), 88 deletions(-)
diff --git a/tools/virsh-domain.c b/tools/virsh-domain.c
index 3232463485..ec427443c4 100644
--- a/tools/virsh-domain.c
+++ b/tools/virsh-domain.c
@@ -765,7 +765,6 @@ cmdAttachDisk(vshControl *ctl, const vshCmd *cmd)
return false;
}
-
vshPrintExtra(ctl, "%s", _("Disk attached successfully\n"));
return true;
}
@@ -1432,7 +1431,6 @@ cmdBlkdeviotune(vshControl *ctl, const vshCmd *cmd)
goto save_error;
}
-
You are mixing changes not related to what the commit message describes.