mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 12:35:17 +00:00
virNWFilterParseParamAttributes: Simplify loop
Signed-off-by: Tim Wiederhake <twiederh@redhat.com> Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
parent
b298fc142f
commit
49d2a42b69
@ -700,9 +700,8 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
|
||||
{
|
||||
g_autoptr(GHashTable) table = virHashNew(virNWFilterVarValueHashFree);
|
||||
|
||||
cur = xmlFirstElementChild(cur);
|
||||
|
||||
while (cur != NULL) {
|
||||
for (cur = xmlFirstElementChild(cur); cur != NULL;
|
||||
cur = xmlNextElementSibling(cur)) {
|
||||
if (virXMLNodeNameEqual(cur, "parameter")) {
|
||||
g_autofree char *nam = virXMLPropString(cur, "name");
|
||||
g_autofree char *val = virXMLPropString(cur, "value");
|
||||
@ -710,7 +709,6 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
|
||||
|
||||
if (nam == NULL || !isValidVarName(nam) ||
|
||||
val == NULL || !isValidVarValue(val)) {
|
||||
cur = xmlNextElementSibling(cur);
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -725,7 +723,6 @@ virNWFilterParseParamAttributes(xmlNodePtr cur)
|
||||
}
|
||||
value = NULL;
|
||||
}
|
||||
cur = xmlNextElementSibling(cur);
|
||||
}
|
||||
|
||||
return g_steal_pointer(&table);
|
||||
|
Loading…
x
Reference in New Issue
Block a user