aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/query/parser.go
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/query/parser.go')
-rw-r--r--pkg/query/parser.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/query/parser.go b/pkg/query/parser.go
index 7ac9918..14cc227 100644
--- a/pkg/query/parser.go
+++ b/pkg/query/parser.go
@@ -290,17 +290,17 @@ func (root Clause) Order() int {
func (root *Clause) DFS() iter.Seq[*Clause] {
return func(yield func(*Clause) bool) {
- stack := make([]*Clause, 0, len(root.Clauses))
+ stack := make([]*Clause, 0, len(root.Clauses)+1)
stack = append(stack, root)
for len(stack) != 0 {
node := stack[len(stack)-1]
+ stack = stack[:len(stack)-1]
if !yield(node) {
return
}
- stack := stack[:len(stack)-1]
stack = append(stack, node.Clauses...)
}
}