Skip to content

Commit b1688bf

Browse files
authored
Merge pull request #93 from optave/perf/wasm-query-extraction
perf: replace manual AST walk with tree-sitter Query API (6.6→4.4 ms/file)
2 parents ce44dfe + e68f6a7 commit b1688bf

4 files changed

Lines changed: 561 additions & 81 deletions

File tree

src/extractors/helpers.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ export function nodeEndLine(node) {
44

55
export function findChild(node, type) {
66
for (let i = 0; i < node.childCount; i++) {
7-
if (node.child(i).type === type) return node.child(i);
7+
const child = node.child(i);
8+
if (child.type === type) return child;
89
}
910
return null;
1011
}

0 commit comments

Comments
 (0)