Fixed iterator for short nodes.
In some cases the iterator didn't properly return the correct key because it didn't append fields to the reverse lookup.
This commit is contained in:
@ -8,12 +8,17 @@ func TestIterator(t *testing.T) {
|
||||
{"do", "verb"},
|
||||
{"ether", "wookiedoo"},
|
||||
{"horse", "stallion"},
|
||||
{"shaman", "horse"},
|
||||
{"doge", "coin"},
|
||||
{"dog", "puppy"},
|
||||
{"somethingveryoddindeedthis is", "myothernodedata"},
|
||||
}
|
||||
v := make(map[string]bool)
|
||||
for _, val := range vals {
|
||||
v[val.k] = false
|
||||
trie.UpdateString(val.k, val.v)
|
||||
}
|
||||
trie.Commit()
|
||||
|
||||
it := trie.Iterator()
|
||||
for it.Next() {
|
||||
|
Reference in New Issue
Block a user