diff options
| author | Kir Kolyshkin <kolyshkin@gmail.com> | 2025-09-17 17:59:32 -0700 |
|---|---|---|
| committer | Sean Liao <sean@liao.dev> | 2025-09-18 15:30:59 -0700 |
| commit | 00bf24fdca72be0e7a05ec7040bc0af35106861d (patch) | |
| tree | 6e464e2b9e7f49c6dacb1e28b98cf41245ee1f80 /src/bytes | |
| parent | f9701d21d2066a1374b3289c4b34cfbf3fbf4f5e (diff) | |
| download | go-00bf24fdca72be0e7a05ec7040bc0af35106861d.tar.xz | |
bytes: use clear in test
Replace for loop with clear built-in, available since Go 1.21.
Change-Id: I66d0124b9004ffd0b52abb679ccff86bb600c1e5
Reviewed-on: https://go-review.googlesource.com/c/go/+/704878
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Mark Freeman <markfreeman@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Sean Liao <sean@liao.dev>
Diffstat (limited to 'src/bytes')
| -rw-r--r-- | src/bytes/bytes_test.go | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/bytes/bytes_test.go b/src/bytes/bytes_test.go index 03f01582c5..f18915c879 100644 --- a/src/bytes/bytes_test.go +++ b/src/bytes/bytes_test.go @@ -891,9 +891,7 @@ func BenchmarkCountSingle(b *testing.B) { b.Fatal("bad count", j, expect) } } - for i := 0; i < len(buf); i++ { - buf[i] = 0 - } + clear(buf) }) } |
