From: Kir Kolyshkin Date: Thu, 18 Sep 2025 00:59:32 +0000 (-0700) Subject: bytes: use clear in test X-Git-Tag: go1.26rc1~830 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=00bf24fdca;p=gostls13.git 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 Reviewed-by: Mark Freeman LUCI-TryBot-Result: Go LUCI Reviewed-by: Sean Liao --- 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) }) }