Added some comparison tests for the new ptrie

This commit is contained in:
obscuren
2014-11-18 12:03:09 +01:00
parent f7417d3552
commit 3220a32ff0
2 changed files with 62 additions and 1 deletions

View File

@ -197,7 +197,12 @@ func (t *Trie) Update(key, value string) {
k := CompactHexDecode(key)
root := t.UpdateState(t.Root, k, value)
var root interface{}
if value != "" {
root = t.UpdateState(t.Root, k, value)
} else {
root = t.deleteState(t.Root, k)
}
t.setRoot(root)
}