Skip to content

Commit 1699154

Browse files
committed
trie: make deletion of Trie more readable when match shortNode
1 parent 0287666 commit 1699154

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

trie/trie.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,7 @@ func (t *Trie) delete(n node, prefix, key []byte) (bool, node, error) {
452452
// from the subtrie. Child can never be nil here since the
453453
// subtrie must contain at least two other values with keys
454454
// longer than n.Key.
455-
dirty, child, err := t.delete(n.Val, append(prefix, key[:len(n.Key)]...), key[len(n.Key):])
455+
dirty, child, err := t.delete(n.Val, append(prefix, key[:matchlen]...), key[matchlen:])
456456
if !dirty || err != nil {
457457
return false, n, err
458458
}

0 commit comments

Comments
 (0)