aboutsummaryrefslogtreecommitdiffstats
path: root/ptrie/iterator.go
diff options
context:
space:
mode:
Diffstat (limited to 'ptrie/iterator.go')
-rw-r--r--ptrie/iterator.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/ptrie/iterator.go b/ptrie/iterator.go
index c6d4f64a0..5714bdbc8 100644
--- a/ptrie/iterator.go
+++ b/ptrie/iterator.go
@@ -65,9 +65,9 @@ func (self *Iterator) next(node Node, key []byte) []byte {
}
} else {
cnode := node.Value()
- skey := key[len(k):]
var ret []byte
+ skey := key[len(k):]
if trie.BeginsWith(key, k) {
ret = self.next(cnode, skey)
} else if bytes.Compare(k, key[:len(k)]) > 0 {
@@ -93,7 +93,8 @@ func (self *Iterator) key(node Node) []byte {
return k
} else {
- return self.key(node.Value())
+ k := trie.RemTerm(node.Key())
+ return append(k, self.key(node.Value())...)
}
case *FullNode:
if node.Value() != nil {