diff options
author | Jes Cok <xigua67damn@gmail.com> | 2024-03-27 20:44:18 +0800 |
---|---|---|
committer | Gopher Robot <gobot@golang.org> | 2024-03-27 18:23:49 +0000 |
commit | d4cc35c4fdbc37ad3bbc42ff6d6dcba6007b169b (patch) | |
tree | eb6ae70562c931c2273853b8ac158e4b87c7b1ae /src/hash | |
parent | 979b34b37c7af73742550ff128d162d0eb2a5f2d (diff) | |
download | go-d4cc35c4fdbc37ad3bbc42ff6d6dcba6007b169b.tar.gz go-d4cc35c4fdbc37ad3bbc42ff6d6dcba6007b169b.zip |
all: make use of builtin clear
Change-Id: I1df0685c75fc1044ba46003a69ecc7dfc53bbc2b
Reviewed-on: https://go-review.googlesource.com/c/go/+/574675
Reviewed-by: Ian Lance Taylor <iant@google.com>
Reviewed-by: Than McIntosh <thanm@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Diffstat (limited to 'src/hash')
-rw-r--r-- | src/hash/maphash/smhasher_test.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/hash/maphash/smhasher_test.go b/src/hash/maphash/smhasher_test.go index 28cdae0444..7fa30aa12f 100644 --- a/src/hash/maphash/smhasher_test.go +++ b/src/hash/maphash/smhasher_test.go @@ -318,9 +318,7 @@ type bytesKey struct { } func (k *bytesKey) clear() { - for i := range k.b { - k.b[i] = 0 - } + clear(k.b) } func (k *bytesKey) random(r *rand.Rand) { randBytes(r, k.b) |