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