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>
This commit is contained in:
Kir Kolyshkin 2025-09-17 17:59:32 -07:00 committed by Sean Liao
parent f9701d21d2
commit 00bf24fdca

View file

@ -891,9 +891,7 @@ func BenchmarkCountSingle(b *testing.B) {
b.Fatal("bad count", j, expect) b.Fatal("bad count", j, expect)
} }
} }
for i := 0; i < len(buf); i++ { clear(buf)
buf[i] = 0
}
}) })
} }