mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 10:50:44 +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 {
|
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
|
||||||
}
|
}
|
||||||
|
|
@ -251,7 +251,7 @@ func (s *stateObject) SetState(db Database, key, value common.Hash) {
|
||||||
func (s *stateObject) SetStorage(storage map[common.Hash]common.Hash) {
|
func (s *stateObject) SetStorage(storage map[common.Hash]common.Hash) {
|
||||||
// Allocate fake storage if it's nil.
|
// Allocate fake storage if it's nil.
|
||||||
if s.fakeStorage == nil {
|
if s.fakeStorage == nil {
|
||||||
s.fakeStorage = make(Storage)
|
s.fakeStorage = make(Storage, len(storage))
|
||||||
}
|
}
|
||||||
for key, value := range storage {
|
for key, value := range storage {
|
||||||
s.fakeStorage[key] = value
|
s.fakeStorage[key] = value
|
||||||
|
|
|
||||||
|
|
@ -37,7 +37,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
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue