chore: optimize DomainTrie for only one child

This commit is contained in:
wwqgtxx
2022-11-30 19:42:05 +08:00
parent 84caee94af
commit df8e129fc6
6 changed files with 49 additions and 20 deletions

View File

@@ -119,8 +119,8 @@ func (t *DomainTrie[T]) search(node *Node[T], parts []string) *Node[T] {
return node.getChild(dotWildcard)
}
func (t *DomainTrie[T]) FinishInsert() {
t.root.finishAdd()
func (t *DomainTrie[T]) Optimize() {
t.root.optimize()
}
// New returns a new, empty Trie.