Skip to content

Commit 078a5ec

Browse files
authored
core/state: improve accessList copy (#33024)
1 parent 7fb91f3 commit 078a5ec

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

core/state/access_list.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,10 @@ func newAccessList() *accessList {
6161

6262
// Copy creates an independent copy of an accessList.
6363
func (al *accessList) Copy() *accessList {
64-
cp := newAccessList()
65-
cp.addresses = maps.Clone(al.addresses)
66-
cp.slots = make([]map[common.Hash]struct{}, len(al.slots))
64+
cp := &accessList{
65+
addresses: maps.Clone(al.addresses),
66+
slots: make([]map[common.Hash]struct{}, len(al.slots)),
67+
}
6768
for i, slotMap := range al.slots {
6869
cp.slots[i] = maps.Clone(slotMap)
6970
}

0 commit comments

Comments
 (0)