aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/query/parser.go
diff options
context:
space:
mode:
authorJP Appel <jeanpierre.appel01@gmail.com>2025-06-15 13:26:17 -0400
committerJP Appel <jeanpierre.appel01@gmail.com>2025-06-15 13:26:17 -0400
commitbb84196aaf227904e8cb9afc846a829a1e6e0365 (patch)
tree9867ed04d18c03627c95fe25aff7cf2cfcbe8842 /pkg/query/parser.go
parent6b71d6419505546bdffd1ce3295fb3e01d466449 (diff)
Update tests and fix minor bugs
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...)
}
}