triedb: opt storageKey

This commit is contained in:
cuiweixie 2025-09-26 00:01:02 +08:00
parent 7d8ccddaac
commit b0c2755ce3
No known key found for this signature in database
GPG key ID: 16DF64EE15E495A3

View file

@ -28,8 +28,8 @@ import (
// storageKey returns a key for uniquely identifying the storage slot. // storageKey returns a key for uniquely identifying the storage slot.
func storageKey(accountHash common.Hash, slotHash common.Hash) [64]byte { func storageKey(accountHash common.Hash, slotHash common.Hash) [64]byte {
var key [64]byte var key [64]byte
copy(key[:32], accountHash[:]) *(*[32]byte)(key[32:]) = slotHash
copy(key[32:], slotHash[:]) *(*[32]byte)(key[:32]) = accountHash
return key return key
} }