core/state: fix unnecessary conversion

This commit is contained in:
Felix Lange 2019-11-15 12:03:36 +01:00
parent 464b42eff6
commit 9386e3e153

View file

@ -35,9 +35,7 @@ func BenchmarkCutOriginal(b *testing.B) {
func BenchmarkCutsetterFn(b *testing.B) { func BenchmarkCutsetterFn(b *testing.B) {
value := common.HexToHash("0x01") value := common.HexToHash("0x01")
cutSetFn := func(r rune) bool { cutSetFn := func(r rune) bool { return r == 0 }
return int32(r) == int32(0)
}
for i := 0; i < b.N; i++ { for i := 0; i < b.N; i++ {
bytes.TrimLeftFunc(value[:], cutSetFn) bytes.TrimLeftFunc(value[:], cutSetFn)
} }