Unverified Commit 44893be0 authored by Seungbae.yu's avatar Seungbae.yu Committed by GitHub

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

parent 714fb302
...@@ -49,7 +49,7 @@ func (s Storage) String() (str string) { ...@@ -49,7 +49,7 @@ func (s Storage) String() (str string) {
} }
func (s Storage) Copy() Storage { func (s Storage) Copy() Storage {
cpy := make(Storage) cpy := make(Storage, len(s))
for key, value := range s { for key, value := range s {
cpy[key] = value cpy[key] = value
} }
......
...@@ -40,7 +40,7 @@ type Storage map[common.Hash]common.Hash ...@@ -40,7 +40,7 @@ type Storage map[common.Hash]common.Hash
// Copy duplicates the current storage. // Copy duplicates the current storage.
func (s Storage) Copy() Storage { func (s Storage) Copy() Storage {
cpy := make(Storage) cpy := make(Storage, len(s))
for key, value := range s { for key, value := range s {
cpy[key] = value cpy[key] = value
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment