diff options
| author | JP Appel <jeanpierre.appel01@gmail.com> | 2025-06-15 13:26:17 -0400 |
|---|---|---|
| committer | JP Appel <jeanpierre.appel01@gmail.com> | 2025-06-15 13:26:17 -0400 |
| commit | bb84196aaf227904e8cb9afc846a829a1e6e0365 (patch) | |
| tree | 9867ed04d18c03627c95fe25aff7cf2cfcbe8842 /pkg/query/parser.go | |
| parent | 6b71d6419505546bdffd1ce3295fb3e01d466449 (diff) | |
Update tests and fix minor bugs
Diffstat (limited to 'pkg/query/parser.go')
| -rw-r--r-- | pkg/query/parser.go | 4 |
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...) } } |
