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

This commit is contained in:
Seungbae.yu 2022-07-12 16:08:45 +09:00 committed by Larry
parent e91c40ddef
commit 0f96641ae4
2 changed files with 2 additions and 2 deletions

@ -50,7 +50,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
}