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