mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-26 08:26:20 +00:00
parent
390ea247d3
commit
52f5766059
2 changed files with 3 additions and 3 deletions
|
|
@ -46,7 +46,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
|
||||
}
|
||||
|
|
@ -251,7 +251,7 @@ func (s *stateObject) SetState(db Database, key, value common.Hash) {
|
|||
func (s *stateObject) SetStorage(storage map[common.Hash]common.Hash) {
|
||||
// Allocate fake storage if it's nil.
|
||||
if s.fakeStorage == nil {
|
||||
s.fakeStorage = make(Storage)
|
||||
s.fakeStorage = make(Storage, len(storage))
|
||||
}
|
||||
for key, value := range storage {
|
||||
s.fakeStorage[key] = value
|
||||
|
|
|
|||
|
|
@ -37,7 +37,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 a new issue