From bb84196aaf227904e8cb9afc846a829a1e6e0365 Mon Sep 17 00:00:00 2001 From: JP Appel Date: Sun, 15 Jun 2025 13:26:17 -0400 Subject: Update tests and fix minor bugs --- pkg/query/parser.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'pkg/query/parser.go') 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...) } } -- cgit v1.2.3