Skip to content

Commit bbb6627

Browse files
committed
fix(node): avoid stack overflow in QueryNodeCursor.Len()
1 parent 9c6fdc6 commit bbb6627

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

node.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -217,9 +217,7 @@ func (c *QueryNodeCursor) Query() *sitter.Query {
217217

218218
func (c *QueryNodeCursor) Len() int {
219219
if c.matchCursor == nil {
220-
if !c.NextMatch() {
221-
return 0
222-
}
220+
return 0
223221
}
224222
return len(c.matchCursor.Captures())
225223
}

0 commit comments

Comments
 (0)