Skip to content

Conversation

@winway
Copy link

@winway winway commented Feb 28, 2018

add methods:
func Free(t *Trie) Free all Nodes of the Trie, renew the root Node.
func (n *Node) FreeChild() Free the node and it's children.

add methods:
func Free(t *Trie) Free all Nodes of the Trie, renew the root Node.
func (n *Node) FreeChild() Free the node and it's children.
}

// Free all Nodes of the Trie, renew the root Node.
func Free(t *Trie) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry for being so late to review this. Could you provide a use case in the PR message and also this needs a test.

Aside from that, I'd prefer this to be a method on *Trie and be named (*Trie).Reset().

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants