trie: unset the edge valuenode as nilValuenode

This commit is contained in:
rjl493456442 2020-04-24 09:32:58 +08:00
parent 200f567e69
commit e18e7775b3

View file

@ -265,7 +265,7 @@ func unset(root node, rest []byte, removeLeft bool) {
case *shortNode:
rn.flags = nodeFlag{dirty: true}
if _, ok := rn.Val.(valueNode); ok {
rn.Val = nil
rn.Val = nilValueNode
return
}
unset(rn.Val, rest[len(rn.Key):], removeLeft)