testing/quick: use Uint64 instead of Int63

Followup to CL 39152.

Change-Id: I9bfed0c6071ea3d3a43294a6c4a50edc131368cf
Reviewed-on: https://go-review.googlesource.com/39313
Run-TryBot: Russ Cox <rsc@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Russ Cox 2017-04-03 14:14:09 -04:00
parent 476f55fd8a
commit a7b51cfb47
2 changed files with 19 additions and 5 deletions

View file

@ -46,11 +46,7 @@ func randFloat64(rand *rand.Rand) float64 {
// randInt64 returns a random int64.
func randInt64(rand *rand.Rand) int64 {
x := rand.Int63() - 1<<62
// x in [-2⁶²,2⁶²), so top two bits are 00 or 11, never 10 or 01.
// Mix in some bits from the middle.
x ^= x<<29 ^ x<<43
return x
return int64(rand.Uint64())
}
// complexSize is the maximum length of arbitrary values that contain other