core, eth: pre-allocate map in storage copy (#25279)
This commit is contained in:
parent
e91c40ddef
commit
0f96641ae4
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user