mirror of
https://github.com/golang/go
synced 2024-11-21 15:04:44 -07:00
json: fix test if rand returns 0.
Fixes test when run with gccgo using optimization, which changes the order of the calls to rand. R=golang-dev, gri CC=golang-dev https://golang.org/cl/4639101
This commit is contained in:
parent
6732bd3526
commit
7b0bb48056
@ -252,7 +252,10 @@ func genArray(n int) []interface{} {
|
||||
if f > n {
|
||||
f = n
|
||||
}
|
||||
x := make([]interface{}, int(f))
|
||||
if n > 0 && f == 0 {
|
||||
f = 1
|
||||
}
|
||||
x := make([]interface{}, f)
|
||||
for i := range x {
|
||||
x[i] = genValue(((i+1)*n)/f - (i*n)/f)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user