Skip to content

Commit

Permalink
Clear nodes slices before releasing
Browse files Browse the repository at this point in the history
  • Loading branch information
ghettovoice committed Nov 13, 2024
1 parent beeb40c commit 3da356c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
9 changes: 1 addition & 8 deletions node.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,6 @@ func newNodes() Nodes {
}

func (ns Nodes) free() {
clear(ns)
nodesPool.Put(ns[:0])
}

func freeNodesChildren(ns Nodes) {
for _, n := range ns {
if n.Children != nil {
n.Children.free()
}
}
}
2 changes: 1 addition & 1 deletion abnf_test.go → node_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"github.com/ghettovoice/abnf"
)

var _ = Describe("Abnf", func() {
var _ = Describe("ABNF", func() {
Describe("Node", func() {
var n abnf.Node

Expand Down

0 comments on commit 3da356c

Please sign in to comment.