diff options
author | obscuren <geffobscura@gmail.com> | 2014-11-19 22:05:08 +0800 |
---|---|---|
committer | obscuren <geffobscura@gmail.com> | 2014-11-19 22:05:08 +0800 |
commit | e70529a97785012368e7e0d5b272cccab705e551 (patch) | |
tree | ee74d588bda2352d0026f179f2e7a9e8c210e57b /ptrie/fullnode.go | |
parent | 14e2e488fdf0f4d6ed1a5a48ffbbe883faa7edb6 (diff) | |
download | go-tangerine-e70529a97785012368e7e0d5b272cccab705e551.tar go-tangerine-e70529a97785012368e7e0d5b272cccab705e551.tar.gz go-tangerine-e70529a97785012368e7e0d5b272cccab705e551.tar.bz2 go-tangerine-e70529a97785012368e7e0d5b272cccab705e551.tar.lz go-tangerine-e70529a97785012368e7e0d5b272cccab705e551.tar.xz go-tangerine-e70529a97785012368e7e0d5b272cccab705e551.tar.zst go-tangerine-e70529a97785012368e7e0d5b272cccab705e551.zip |
Added new iterator and tests
Diffstat (limited to 'ptrie/fullnode.go')
-rw-r--r-- | ptrie/fullnode.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ptrie/fullnode.go b/ptrie/fullnode.go index 2b1a62789..eaa4611b6 100644 --- a/ptrie/fullnode.go +++ b/ptrie/fullnode.go @@ -14,6 +14,9 @@ func (self *FullNode) Value() Node { self.nodes[16] = self.trie.trans(self.nodes[16]) return self.nodes[16] } +func (self *FullNode) Branches() []Node { + return self.nodes[:16] +} func (self *FullNode) Copy() Node { return self } @@ -49,7 +52,7 @@ func (self *FullNode) set(k byte, value Node) { self.nodes[int(k)] = value } -func (self *FullNode) get(i byte) Node { +func (self *FullNode) branch(i byte) Node { if self.nodes[int(i)] != nil { self.nodes[int(i)] = self.trie.trans(self.nodes[int(i)]) |