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

This commit is contained in:
Seungbae.yu
2022-07-12 10:08:45 +03:00
committed by GitHub
parent 714fb302a5
commit 44893be0d6
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
}
+1 -1
View File
@@ -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
}