diff options
author | Ethan Buchman <ethan@coinculture.info> | 2015-08-06 15:11:10 +0800 |
---|---|---|
committer | Ethan Buchman <ethan@coinculture.info> | 2015-08-06 15:17:59 +0800 |
commit | c1d516546d221de898ddeb12a77477d992d125df (patch) | |
tree | 9f2208127d4325546ac524b9e56ae8cd525abb92 /trie/shortnode.go | |
parent | 98100f472c3bee473ea32044e47e82835b9cfadb (diff) | |
download | go-tangerine-c1d516546d221de898ddeb12a77477d992d125df.tar go-tangerine-c1d516546d221de898ddeb12a77477d992d125df.tar.gz go-tangerine-c1d516546d221de898ddeb12a77477d992d125df.tar.bz2 go-tangerine-c1d516546d221de898ddeb12a77477d992d125df.tar.lz go-tangerine-c1d516546d221de898ddeb12a77477d992d125df.tar.xz go-tangerine-c1d516546d221de898ddeb12a77477d992d125df.tar.zst go-tangerine-c1d516546d221de898ddeb12a77477d992d125df.zip |
faster hex-prefix codec and string -> []byte
Diffstat (limited to 'trie/shortnode.go')
-rw-r--r-- | trie/shortnode.go | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/trie/shortnode.go b/trie/shortnode.go index b5fc6d1f9..569d5f109 100644 --- a/trie/shortnode.go +++ b/trie/shortnode.go @@ -26,7 +26,7 @@ type ShortNode struct { } func NewShortNode(t *Trie, key []byte, value Node) *ShortNode { - return &ShortNode{t, []byte(CompactEncode(key)), value, false} + return &ShortNode{t, CompactEncode(key), value, false} } func (self *ShortNode) Value() Node { self.value = self.trie.trans(self.value) @@ -49,7 +49,7 @@ func (self *ShortNode) Hash() interface{} { } func (self *ShortNode) Key() []byte { - return CompactDecode(string(self.key)) + return CompactDecode(self.key) } func (self *ShortNode) setDirty(dirty bool) { |