mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-08-20 02:42:27 +00:00
core/state: remove unnecessary preallocation in StateDB.Copy
Both stateObjectsDestruct and preimages fields are assigned by the value returned by maps.Clone. The preallocation is a waste.
This commit is contained in:
parent
74e8d2da97
commit
8f4759db9d
1 changed files with 2 additions and 2 deletions
|
|
@ -703,11 +703,11 @@ func (s *StateDB) Copy() *StateDB {
|
|||
stateObjects: make(map[common.Address]*stateObject, len(s.journal.dirties)),
|
||||
stateObjectsPending: make(map[common.Address]struct{}, len(s.stateObjectsPending)),
|
||||
stateObjectsDirty: make(map[common.Address]struct{}, len(s.journal.dirties)),
|
||||
stateObjectsDestruct: make(map[common.Address]*types.StateAccount, len(s.stateObjectsDestruct)),
|
||||
stateObjectsDestruct: make(map[common.Address]*types.StateAccount),
|
||||
refund: s.refund,
|
||||
logs: make(map[common.Hash][]*types.Log, len(s.logs)),
|
||||
logSize: s.logSize,
|
||||
preimages: make(map[common.Hash][]byte, len(s.preimages)),
|
||||
preimages: make(map[common.Hash][]byte),
|
||||
journal: newJournal(),
|
||||
hasher: crypto.NewKeccakState(),
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue