core, eth: pre-allocate map in storage copy (#25279)

pull/25288/head
Seungbae.yu 3 years ago committed by GitHub
parent 714fb302a5
commit 44893be0d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      core/state/state_object.go
  2. 2
      eth/tracers/logger/logger.go

@ -49,7 +49,7 @@ func (s Storage) String() (str string) {
}
func (s Storage) Copy() Storage {
cpy := make(Storage)
cpy := make(Storage, len(s))
for key, value := range s {
cpy[key] = value
}

@ -40,7 +40,7 @@ type Storage map[common.Hash]common.Hash
// Copy duplicates the current storage.
func (s Storage) Copy() Storage {
cpy := make(Storage)
cpy := make(Storage, len(s))
for key, value := range s {
cpy[key] = value
}

Loading…
Cancel
Save