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.
This commit is contained in:
Wenbiao Zheng
2018-05-29 23:48:43 +08:00
committed by Felix Lange
parent d51faee240
commit 38c7eb0f26
5 changed files with 37 additions and 37 deletions

View File

@ -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
}