core/state: improve accessList copy (#33024)
Some checks are pending
/ Docker Image (push) Waiting to run
/ Linux Build (push) Waiting to run
/ Linux Build (arm) (push) Waiting to run
/ Keeper Build (push) Waiting to run
/ Windows Build (push) Waiting to run

This commit is contained in:
cui 2025-10-26 16:13:59 +08:00 committed by GitHub
parent 7fb91f3cd5
commit 078a5ecb7d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -61,9 +61,10 @@ func newAccessList() *accessList {
// Copy creates an independent copy of an accessList.
func (al *accessList) Copy() *accessList {
cp := newAccessList()
cp.addresses = maps.Clone(al.addresses)
cp.slots = make([]map[common.Hash]struct{}, len(al.slots))
cp := &accessList{
addresses: maps.Clone(al.addresses),
slots: make([]map[common.Hash]struct{}, len(al.slots)),
}
for i, slotMap := range al.slots {
cp.slots[i] = maps.Clone(slotMap)
}