mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-02-26 15:47:21 +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.
|
// Copy creates an independent copy of an accessList.
|
||||||
func (al *accessList) Copy() *accessList {
|
func (al *accessList) Copy() *accessList {
|
||||||
cp := newAccessList()
|
cp := &accessList{
|
||||||
cp.addresses = maps.Clone(al.addresses)
|
addresses: maps.Clone(al.addresses),
|
||||||
cp.slots = make([]map[common.Hash]struct{}, len(al.slots))
|
slots: make([]map[common.Hash]struct{}, len(al.slots)),
|
||||||
|
}
|
||||||
for i, slotMap := range al.slots {
|
for i, slotMap := range al.slots {
|
||||||
cp.slots[i] = maps.Clone(slotMap)
|
cp.slots[i] = maps.Clone(slotMap)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue