Simplify control flow in xmlParseStartTag2
Remove some goto labels and deduplicate a bit of code after handling
namespaces.
Before:
loop {
parseAttribute
if (ok) {
if (defaultNamespace) {
handleDefaultNamespace
if (error)
goto skip_default_ns;
handleDefaultNamespace
skip_default_ns:
freeAttr
nextAttr
continue;
}
if (namespace) {
handleNamespace
if (error)
goto skip_ns;
handleNamespace
skip_ns:
freeAttr
nextAttr;
continue;
}
handleAttr
} else {
freeAttr
}
nextAttr
}
After:
loop {
parseAttribute
if (!ok)
goto next_attr;
if (defaultNamespace) {
handleDefaultNamespace
if (error)
goto next_attr;
handleDefaultNamespace
} else if (namespace) {
handleNamespace
if (error)
goto next_attr;
handleNamespace
} else {
handleAttr
}
next_attr:
freeAttr
nextAttr
}
1 file changed