mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-07-18 02:40:45 +00:00
core/state: using slices.Clone (#29366)
This commit is contained in:
parent
3754a6cc92
commit
7481398a24
1 changed files with 2 additions and 3 deletions
|
|
@ -20,6 +20,7 @@ package state
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/big"
|
"math/big"
|
||||||
|
"slices"
|
||||||
"sort"
|
"sort"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -243,9 +244,7 @@ func (s *StateDB) Logs() []*types.Log {
|
||||||
func (s *StateDB) AddPreimage(hash common.Hash, preimage []byte) {
|
func (s *StateDB) AddPreimage(hash common.Hash, preimage []byte) {
|
||||||
if _, ok := s.preimages[hash]; !ok {
|
if _, ok := s.preimages[hash]; !ok {
|
||||||
s.journal.append(addPreimageChange{hash: hash})
|
s.journal.append(addPreimageChange{hash: hash})
|
||||||
pi := make([]byte, len(preimage))
|
s.preimages[hash] = slices.Clone(preimage)
|
||||||
copy(pi, preimage)
|
|
||||||
s.preimages[hash] = pi
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue