diff --git a/trie/encoding_test.go b/trie/encoding_test.go index ac50b5d025..20cc250d95 100644 --- a/trie/encoding_test.go +++ b/trie/encoding_test.go @@ -99,7 +99,7 @@ func TestHexToCompactInPlaceRandom(t *testing.T) { key := make([]byte, l) crand.Read(key) hexBytes := keybytesToHex(key) - hexOrig := []byte(string(hexBytes)) + hexOrig := append([]byte(nil), hexBytes...) // copy without extra string alloc exp := hexToCompact(hexBytes) got := hexToCompactInPlace(hexBytes)