1
0
mirror of https://github.com/golang/go synced 2024-11-26 22:51:23 -07:00
This commit is contained in:
Jes Cok 2023-07-26 07:00:15 +08:00
parent 42b6dfa639
commit 54455839b6

View File

@ -440,10 +440,7 @@ func BenchmarkGoMapClear(b *testing.B) {
m := make(map[float64]int, size)
for i := 0; i < b.N; i++ {
m[1.0] = size // Add one element so len(m) != 0 avoiding fast paths.
for k := range m {
delete(m, k)
}
// clear(m)
clear(m)
}
})
}