Re: [PATCH 3/2] qemu: cap: Refactor access to array in virQEMUCapsProbeQMPMachineTypes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jul 29, 2016 at 10:40:57AM +0200, Peter Krempa wrote:
Use a temporary pointer rather than always recalculating the index in a
very verbose way.
---
src/qemu/qemu_capabilities.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 23d4a65..c612960 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -2473,6 +2473,7 @@ static int
virQEMUCapsProbeQMPMachineTypes(virQEMUCapsPtr qemuCaps,
                                qemuMonitorPtr mon)
{
+    struct virQEMUCapsMachineType *mach;

Declaring this variable inside the for loop would be nicer, since it's
only used there.

Jan

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]