[PATCH 6/7] util: Remove need for local 'nelems'

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

 



Since it's only used in loop - just go direct.

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 src/util/virqemu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virqemu.c b/src/util/virqemu.c
index 0b516fc..7849d8b 100644
--- a/src/util/virqemu.c
+++ b/src/util/virqemu.c
@@ -85,12 +85,11 @@ virQEMUBuildCommandLineJSONArrayNumbered(const char *key,
                                          virBufferPtr buf)
 {
     const virJSONValue *member;
-    ssize_t nelems = virJSONValueArraySize(array);
     char *prefix = NULL;
     size_t i;
     int ret = 0;
 
-    for (i = 0; i < nelems; i++) {
+    for (i = 0; i < virJSONValueArraySize(array); i++) {
         member = virJSONValueArrayGet((virJSONValuePtr) array, i);
 
         if (virAsprintf(&prefix, "%s.%zu", key, i) < 0)
-- 
2.7.4

--
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]