diff --git a/radix.go b/radix.go index 3ba8379..c5287c3 100644 --- a/radix.go +++ b/radix.go @@ -149,7 +149,7 @@ func longestPrefix(k1, k2 string) int { } // Insert is used to add a newentry or update -// an existing entry. Returns if updated. +// an existing entry. Returns true if an existing record is updated. func (t *Tree) Insert(s string, v interface{}) (interface{}, bool) { var parent *node n := t.root @@ -219,7 +219,7 @@ func (t *Tree) Insert(s string, v interface{}) (interface{}, bool) { val: v, } - // If the new key is a subset, add to to this node + // If the new key is a subset, add to this node search = search[commonPrefix:] if len(search) == 0 { child.leaf = leaf