Skip to content

Commit b8feb5c

Browse files
authored
core/state: reduce one alloc ethereum#33024 (XinFinOrg#1784)
1 parent 9287ad4 commit b8feb5c

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
@@ -58,9 +58,10 @@ func newAccessList() *accessList {
5858

5959
// Copy creates an independent copy of an accessList.
6060
func (al *accessList) Copy() *accessList {
61-
cp := newAccessList()
62-
cp.addresses = maps.Clone(al.addresses)
63-
cp.slots = make([]map[common.Hash]struct{}, len(al.slots))
61+
cp := &accessList{
62+
addresses: maps.Clone(al.addresses),
63+
slots: make([]map[common.Hash]struct{}, len(al.slots)),
64+
}
6465
for i, slotMap := range al.slots {
6566
cp.slots[i] = maps.Clone(slotMap)
6667
}

0 commit comments

Comments
 (0)