aboutsummaryrefslogtreecommitdiff
path: root/src/testing/benchmark.go
diff options
context:
space:
mode:
authorJes Cok <xigua67damn@gmail.com>2023-07-25 23:10:34 +0000
committerGopher Robot <gobot@golang.org>2023-07-27 22:07:13 +0000
commit3bc28402fae2a1646e4d2756344b5eb34994d25f (patch)
treea7b1cb6fe83f489e038e9a11204eb0b9795ee802 /src/testing/benchmark.go
parent1c10d743eaff174f08e48dff85f64ade0b92425c (diff)
downloadgo-3bc28402fae2a1646e4d2756344b5eb34994d25f.tar.xz
all: use built-in clear to clear maps
Change-Id: I7f4ac72fe3230d8b7486fab0c925015cefcbe355 GitHub-Last-Rev: 54455839b674f980fb6c3afceb433db4833d340e GitHub-Pull-Request: golang/go#61544 Reviewed-on: https://go-review.googlesource.com/c/go/+/512376 Reviewed-by: Ian Lance Taylor <iant@google.com> Run-TryBot: Keith Randall <khr@golang.org> Reviewed-by: Bryan Mills <bcmills@google.com> Run-TryBot: Ian Lance Taylor <iant@google.com> Auto-Submit: Ian Lance Taylor <iant@google.com> TryBot-Result: Gopher Robot <gobot@golang.org>
Diffstat (limited to 'src/testing/benchmark.go')
-rw-r--r--src/testing/benchmark.go4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/testing/benchmark.go b/src/testing/benchmark.go
index be9b87f80b..0f4fc3d930 100644
--- a/src/testing/benchmark.go
+++ b/src/testing/benchmark.go
@@ -151,9 +151,7 @@ func (b *B) ResetTimer() {
// Pre-size it to make more allocation unlikely.
b.extra = make(map[string]float64, 16)
} else {
- for k := range b.extra {
- delete(b.extra, k)
- }
+ clear(b.extra)
}
if b.timerOn {
runtime.ReadMemStats(&memStats)