core/types/bal: reduce alloc

This commit is contained in:
cuiweixie 2026-01-12 20:12:24 +08:00
parent 127d1f42bb
commit 47e8f1184c

View file

@ -152,7 +152,9 @@ func (b *ConstructionBlockAccessList) PrettyPrint() string {
// Copy returns a deep copy of the access list. // Copy returns a deep copy of the access list.
func (b *ConstructionBlockAccessList) Copy() *ConstructionBlockAccessList { func (b *ConstructionBlockAccessList) Copy() *ConstructionBlockAccessList {
res := NewConstructionBlockAccessList() res := ConstructionBlockAccessList{
Accounts: make(map[common.Address]*ConstructionAccountAccess, len(b.Accounts)),
}
for addr, aa := range b.Accounts { for addr, aa := range b.Accounts {
var aaCopy ConstructionAccountAccess var aaCopy ConstructionAccountAccess