mirror of
https://github.com/ethereum/go-ethereum.git
synced 2026-06-19 21:31:37 +00:00
Merge pull request #710 from gzliudan/fix-s1001
common: fix staticcheck warning S1001: replace loop with copy
This commit is contained in:
commit
95f383d586
1 changed files with 2 additions and 6 deletions
|
|
@ -143,9 +143,7 @@ func (h *Hash) SetString(s string) { h.SetBytes([]byte(s)) }
|
|||
|
||||
// Sets h to other
|
||||
func (h *Hash) Set(other Hash) {
|
||||
for i, v := range other {
|
||||
h[i] = v
|
||||
}
|
||||
copy(h[:], other[:])
|
||||
}
|
||||
|
||||
// Generate implements testing/quick.Generator.
|
||||
|
|
@ -262,9 +260,7 @@ func (a *Address) SetString(s string) { a.SetBytes([]byte(s)) }
|
|||
|
||||
// Sets a to other
|
||||
func (a *Address) Set(other Address) {
|
||||
for i, v := range other {
|
||||
a[i] = v
|
||||
}
|
||||
copy(a[:], other[:])
|
||||
}
|
||||
|
||||
// MarshalText returns the hex representation of a.
|
||||
|
|
|
|||
Loading…
Reference in a new issue