aboutsummaryrefslogtreecommitdiffstats
path: root/trie
diff options
context:
space:
mode:
Diffstat (limited to 'trie')
-rw-r--r--trie/encoding.go4
-rw-r--r--trie/node.go2
2 files changed, 3 insertions, 3 deletions
diff --git a/trie/encoding.go b/trie/encoding.go
index 4906bc90b..5c42c556f 100644
--- a/trie/encoding.go
+++ b/trie/encoding.go
@@ -49,7 +49,7 @@ func CompactDecode(str string) []byte {
func CompactHexDecode(str string) []byte {
base := "0123456789abcdef"
- hexSlice := make([]byte, 0)
+ var hexSlice []byte
enc := hex.EncodeToString([]byte(str))
for _, v := range enc {
@@ -61,7 +61,7 @@ func CompactHexDecode(str string) []byte {
}
func DecodeCompact(key []byte) string {
- base := "0123456789abcdef"
+ const base = "0123456789abcdef"
var str string
for _, v := range key {
diff --git a/trie/node.go b/trie/node.go
index a1f68480f..f28f24771 100644
--- a/trie/node.go
+++ b/trie/node.go
@@ -18,7 +18,7 @@ func (self *ValueNode) String() string { return self.fstring("") }
func (self *FullNode) String() string { return self.fstring("") }
func (self *ShortNode) String() string { return self.fstring("") }
func (self *ValueNode) fstring(ind string) string { return fmt.Sprintf("%x ", self.data) }
-func (self *HashNode) fstring(ind string) string { return fmt.Sprintf("%x ", self.key) }
+func (self *HashNode) fstring(ind string) string { return fmt.Sprintf("< %x > ", self.key) }
// Full node
func (self *FullNode) fstring(ind string) string {