aboutsummaryrefslogtreecommitdiffstats
path: root/trie/encoding.go
diff options
context:
space:
mode:
authorWenbiao Zheng <delweng@gmail.com>2018-05-29 23:48:43 +0800
committerFelix Lange <fjl@users.noreply.github.com>2018-05-29 23:48:43 +0800
commit38c7eb0f26eaa8df229d27e92f12e253313a6c8d (patch)
tree93b57c84013170b006b3cb47dd7b6341c387afcf /trie/encoding.go
parentd51faee2402072a6af66b8f08f6334944585419d (diff)
downloadgo-tangerine-38c7eb0f26eaa8df229d27e92f12e253313a6c8d.tar.gz
go-tangerine-38c7eb0f26eaa8df229d27e92f12e253313a6c8d.tar.zst
go-tangerine-38c7eb0f26eaa8df229d27e92f12e253313a6c8d.zip
trie: rename TrieSync to Sync and improve hexToKeybytes (#16804)
This removes a golint warning: type name will be used as trie.TrieSync by other packages, and that stutters; consider calling this Sync. In hexToKeybytes len(hex) is even and (even+1)/2 == even/2, remove the +1.
Diffstat (limited to 'trie/encoding.go')
-rw-r--r--trie/encoding.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/trie/encoding.go b/trie/encoding.go
index e96a786e4..221fa6d3a 100644
--- a/trie/encoding.go
+++ b/trie/encoding.go
@@ -83,7 +83,7 @@ func hexToKeybytes(hex []byte) []byte {
if len(hex)&1 != 0 {
panic("can't convert hex key of odd length")
}
- key := make([]byte, (len(hex)+1)/2)
+ key := make([]byte, len(hex)/2)
decodeNibbles(hex, key)
return key
}