From d4cc35c4fdbc37ad3bbc42ff6d6dcba6007b169b Mon Sep 17 00:00:00 2001 From: Jes Cok Date: Wed, 27 Mar 2024 20:44:18 +0800 Subject: all: make use of builtin clear Change-Id: I1df0685c75fc1044ba46003a69ecc7dfc53bbc2b Reviewed-on: https://go-review.googlesource.com/c/go/+/574675 Reviewed-by: Ian Lance Taylor Reviewed-by: Than McIntosh LUCI-TryBot-Result: Go LUCI Auto-Submit: Ian Lance Taylor --- src/runtime/debug/garbage.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/runtime/debug') diff --git a/src/runtime/debug/garbage.go b/src/runtime/debug/garbage.go index cb3248d64d..4f11c58733 100644 --- a/src/runtime/debug/garbage.go +++ b/src/runtime/debug/garbage.go @@ -63,9 +63,7 @@ func ReadGCStats(stats *GCStats) { if len(stats.PauseQuantiles) > 0 { if n == 0 { - for i := range stats.PauseQuantiles { - stats.PauseQuantiles[i] = 0 - } + clear(stats.PauseQuantiles) } else { // There's room for a second copy of the data in stats.Pause. // See the allocation at the top of the function. -- cgit v1.3