From 9022f5034f952405d02f89c905104c80f0c13b8f Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 29 Jan 2015 23:17:43 +0100 Subject: default values removed --- trie/encoding.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'trie/encoding.go') 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) } -- cgit v1.2.3 From 705cf6113d5c7cc8cbbbc8201d3c6ea04ae5726b Mon Sep 17 00:00:00 2001 From: obscuren Date: Thu, 29 Jan 2015 23:18:46 +0100 Subject: debug err removed --- trie/encoding.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'trie/encoding.go') diff --git a/trie/encoding.go b/trie/encoding.go index 94ea184c9..5c42c556f 100644 --- a/trie/encoding.go +++ b/trie/encoding.go @@ -70,7 +70,7 @@ func DecodeCompact(key []byte) string { } } - res, err := hex.DecodeString(str) + res, _ := hex.DecodeString(str) return string(res) } -- cgit v1.2.3