refactor(detectArrayStyle): use elements iterator
This commit is contained in:
parent
288f88dfb6
commit
007c5a8a15
1 changed files with 7 additions and 10 deletions
|
@ -122,17 +122,14 @@ fn detectArrayStyle(comptime T: type, element: *xml.Element, options: ParseOptio
|
|||
};
|
||||
|
||||
var matching_fields: usize = 0;
|
||||
for (element.children.items) |content| {
|
||||
switch (content) {
|
||||
.Element => |el| {
|
||||
var element_iterator = element.elements();
|
||||
|
||||
while (element_iterator.next()) |el| {
|
||||
for (field_names) |field_name| {
|
||||
if (std.mem.eql(u8, field_name, el.tag)) {
|
||||
matching_fields += 1;
|
||||
}
|
||||
}
|
||||
},
|
||||
else => continue,
|
||||
}
|
||||
}
|
||||
|
||||
if (matching_fields > 0) {
|
||||
|
|
Loading…
Add table
Reference in a new issue