mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 07:37:20 +00:00
core/state: improve accessList copy (#33024)
This commit is contained in:
parent
7fb91f3cd5
commit
078a5ecb7d
1 changed files with 4 additions and 3 deletions
|
|
@ -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)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue