virsh: virshVcpuinfoPrintAffinity: Use if-else instead of ternary operator

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Peter Krempa 2022-02-28 15:00:00 +01:00
parent 3a00632667
commit 34244cc20d
1 changed files with 6 additions and 2 deletions

View File

@ -6721,8 +6721,12 @@ virshVcpuinfoPrintAffinity(vshControl *ctl,
return -1;
vshPrint(ctl, _("%s (out of %d)"), str, maxcpu);
} else {
for (i = 0; i < maxcpu; i++)
vshPrint(ctl, "%c", VIR_CPU_USED(cpumap, i) ? 'y' : '-');
for (i = 0; i < maxcpu; i++) {
if (VIR_CPU_USED(cpumap, i))
vshPrint(ctl, "y");
else
vshPrint(ctl, "-");
}
}
vshPrint(ctl, "\n");