virNWFilterParseParamAttributes: Iterate over "element" children

"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>
This commit is contained in:
Tim Wiederhake 2021-07-06 10:35:27 +02:00
parent e18d41444e
commit 71a2cdb8ec

View File

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