Skip to content

Commit b97d061

Browse files
committed
chore: remove Node.childrenOfType
Replaced by iterator with type option
1 parent ddaa05e commit b97d061

1 file changed

Lines changed: 0 additions & 13 deletions

File tree

src/Node.zig

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -48,19 +48,6 @@ pub fn getLastChild(self: *Node) !?*Node {
4848
}
4949
}
5050

51-
pub fn childrenOfType(self: Node, allocator: Allocator, ty: Type) !ArrayList(Node) {
52-
switch (self.type) {
53-
inline .document, .element => {
54-
var result = try ArrayList(Node).initCapacity(allocator, self.children.items.len);
55-
for (self.children.items) |child| {
56-
if (child.type == ty) try result.append(allocator, child);
57-
}
58-
return result;
59-
},
60-
else => return error.InvalidOperation,
61-
}
62-
}
63-
6451
pub fn lastChildOfType(self: *Node, ty: Type) !?*Node {
6552
switch (self.type) {
6653
inline .document, .element => {

0 commit comments

Comments
 (0)