Skip to content

Commit

Permalink
Revert "core/state: initialize maps with known size (ethereum#27222)"
Browse files Browse the repository at this point in the history
This reverts commit 73ef7f1.
  • Loading branch information
devopsbo3 authored Nov 10, 2023
1 parent f63892d commit 4e0c675
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/state/statedb.go
Original file line number Diff line number Diff line change
Expand Up @@ -783,13 +783,13 @@ func (s *StateDB) Copy() *StateDB {
state.snap = s.snap

// deep copy needed
state.snapAccounts = make(map[common.Hash][]byte, len(s.snapAccounts))
state.snapAccounts = make(map[common.Hash][]byte)
for k, v := range s.snapAccounts {
state.snapAccounts[k] = v
}
state.snapStorage = make(map[common.Hash]map[common.Hash][]byte, len(s.snapStorage))
state.snapStorage = make(map[common.Hash]map[common.Hash][]byte)
for k, v := range s.snapStorage {
temp := make(map[common.Hash][]byte, len(v))
temp := make(map[common.Hash][]byte)
for kk, vv := range v {
temp[kk] = vv
}
Expand Down Expand Up @@ -1160,7 +1160,7 @@ func (s *StateDB) SlotInAccessList(addr common.Address, slot common.Hash) (addre

// convertAccountSet converts a provided account set from address keyed to hash keyed.
func (s *StateDB) convertAccountSet(set map[common.Address]struct{}) map[common.Hash]struct{} {
ret := make(map[common.Hash]struct{}, len(set))
ret := make(map[common.Hash]struct{})
for addr := range set {
obj, exist := s.stateObjects[addr]
if !exist {
Expand Down

0 comments on commit 4e0c675

Please sign in to comment.