Commit 872ca73c authored by Marcel van Lohuizen's avatar Marcel van Lohuizen Committed by Russ Cox

runtime: don't assume b.N > 0

Change-Id: I2e26717f2563d7633ffd15f4adf63c3d0ee3403f
Reviewed-on: https://go-review.googlesource.com/20856
Run-TryBot: Marcel van Lohuizen <mpvl@golang.org>
Reviewed-by: 's avatarRuss Cox <rsc@golang.org>
parent 3e2e8059
......@@ -428,6 +428,9 @@ func TestPingPongHog(t *testing.T) {
}
func BenchmarkPingPongHog(b *testing.B) {
if b.N == 0 {
return
}
defer runtime.GOMAXPROCS(runtime.GOMAXPROCS(1))
// Create a CPU hog
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment