aboutsummaryrefslogtreecommitdiffstats
path: root/trie/encoding.go
diff options
context:
space:
mode:
authorobscuren <geffobscura@gmail.com>2015-01-30 06:17:43 +0800
committerobscuren <geffobscura@gmail.com>2015-01-30 06:17:43 +0800
commit9022f5034f952405d02f89c905104c80f0c13b8f (patch)
treeff5f31857ea1f422d932986260d382beb57bc5dc /trie/encoding.go
parentbd992e7baf5da01e97fe4e0c85184716daafa7e5 (diff)
downloaddexon-9022f5034f952405d02f89c905104c80f0c13b8f.tar
dexon-9022f5034f952405d02f89c905104c80f0c13b8f.tar.gz
dexon-9022f5034f952405d02f89c905104c80f0c13b8f.tar.bz2
dexon-9022f5034f952405d02f89c905104c80f0c13b8f.tar.lz
dexon-9022f5034f952405d02f89c905104c80f0c13b8f.tar.xz
dexon-9022f5034f952405d02f89c905104c80f0c13b8f.tar.zst
dexon-9022f5034f952405d02f89c905104c80f0c13b8f.zip
default values removed
Diffstat (limited to 'trie/encoding.go')
-rw-r--r--trie/encoding.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/trie/encoding.go b/trie/encoding.go
index 4906bc90b..94ea184c9 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 {
@@ -70,7 +70,7 @@ func DecodeCompact(key []byte) string {
}
}
- res, _ := hex.DecodeString(str)
+ res, err := hex.DecodeString(str)
return string(res)
}