]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virNWFilterParseParamAttributes: Iterate over "element" children
authorTim Wiederhake <twiederh@redhat.com>
Tue, 6 Jul 2021 08:35:27 +0000 (10:35 +0200)
committerTim Wiederhake <twiederh@redhat.com>
Fri, 23 Jul 2021 09:27:05 +0000 (11:27 +0200)
"xmlNextElementSibling()" skips attribute nodes, making the explicit
check for the type of `cur` redundant. This prepares for the removal
of this check in the next commit.

Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
src/conf/nwfilter_params.c

index c94e9679f84aa20792d25d83e8efc7e148385cc8..3754cec55f026ed8e3d44d0153591c9414cdb090 100644 (file)
@@ -703,7 +703,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
 
     GHashTable *table = virHashNew(virNWFilterVarValueHashFree);
 
-    cur = cur->children;
+    cur = xmlFirstElementChild(cur);
 
     while (cur != NULL) {
         if (cur->type == XML_ELEMENT_NODE) {
@@ -739,7 +739,7 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
                 VIR_FREE(val);
             }
         }
-        cur = cur->next;
+        cur = xmlNextElementSibling(cur);
     }
     return table;