diff --git a/pkgs/trie/trie.go b/pkgs/trie/trie.go index 18e340c..d1519a9 100644 --- a/pkgs/trie/trie.go +++ b/pkgs/trie/trie.go @@ -103,6 +103,7 @@ func (n *Node[T]) RemoveSelf(cleanParent bool) { // 修改时需要注意允许在visitorFn中删除当前节点 func (n *Node[T]) Iterate(visitorFn func(path []string, node *Node[T], isWordNode bool) VisitCtrl) { + visitorFn([]string{}, n, true) n.iterate([]string{}, visitorFn) }