Merge pull request #710 from gzliudan/fix-s1001

common: fix staticcheck warning S1001: replace loop with copy
This commit is contained in:
Daniel Liu 2024-10-30 21:05:53 +08:00 committed by GitHub
commit 95f383d586
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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.