Skip to content

Commit 00bf24f

Browse files
kolyshkinseankhliao
authored andcommitted
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 <[email protected]> Reviewed-by: Mark Freeman <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Sean Liao <[email protected]>
1 parent f9701d2 commit 00bf24f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/bytes/bytes_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,9 +891,7 @@ func BenchmarkCountSingle(b *testing.B) {
891891
b.Fatal("bad count", j, expect)
892892
}
893893
}
894-
for i := 0; i < len(buf); i++ {
895-
buf[i] = 0
896-
}
894+
clear(buf)
897895
})
898896
}
899897

0 commit comments

Comments
 (0)