[PATCH 2/7] hypervCreateEmbeddedParam: Don't count elements needlessly

Peter Krempa pkrempa at redhat.com
Fri Jul 23 09:05:45 UTC 2021


'count' is not used after calculating it.

Signed-off-by: Peter Krempa <pkrempa at redhat.com>
---
 src/hyperv/hyperv_wmi.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/src/hyperv/hyperv_wmi.c b/src/hyperv/hyperv_wmi.c
index dc2c6471ab..e211fd5d80 100644
--- a/src/hyperv/hyperv_wmi.c
+++ b/src/hyperv/hyperv_wmi.c
@@ -274,16 +274,11 @@ GHashTable *
 hypervCreateEmbeddedParam(hypervWmiClassInfo *classInfo)
 {
     size_t i;
-    size_t count;
     g_autoptr(GHashTable) table = virHashNew(NULL);
     XmlSerializerInfo *typeinfo = NULL;

     typeinfo = classInfo->serializerInfo;

-    /* loop through the items to find out how many fields there are */
-    for (count = 0; typeinfo[count].name != NULL; count++)
-        ;
-
     for (i = 0; typeinfo[i].name != NULL; i++) {
         XmlSerializerInfo *item = &typeinfo[i];

-- 
2.31.1




More information about the libvir-list mailing list