net/rpc: don't assume b.N > 0

Change-Id: I58c4a75168fd1f797a25735c4151f501f0475332
Reviewed-on: https://go-review.googlesource.com/20854
Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
Marcel van Lohuizen 2016-03-18 16:41:21 +01:00 committed by Russ Cox
parent 6e2deaa1e1
commit d3ce412fa5
1 changed files with 3 additions and 0 deletions

View File

@ -657,6 +657,9 @@ func benchmarkEndToEnd(dial func() (*Client, error), b *testing.B) {
}
func benchmarkEndToEndAsync(dial func() (*Client, error), b *testing.B) {
if b.N == 0 {
return
}
const MaxConcurrentCalls = 100
once.Do(startServer)
client, err := dial()