From: Burak Guven Date: Thu, 14 Sep 2017 02:54:40 +0000 (-0700) Subject: math/rand: fix comment for Shuffle X-Git-Tag: go1.10beta1~1104 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=9cc170f9a5b84d8cc3f477c68f6f2a2dc9196755;p=gostls13.git math/rand: fix comment for Shuffle Shuffle panics if n < 0, not n <= 0. The comment for the (*Rand).Shuffle function is already accurate. Change-Id: I073049310bca9632e50e9ca3ff79eec402122793 Reviewed-on: https://go-review.googlesource.com/63750 Reviewed-by: Ian Lance Taylor --- diff --git a/src/math/rand/rand.go b/src/math/rand/rand.go index 85871725a6..8edb22e1da 100644 --- a/src/math/rand/rand.go +++ b/src/math/rand/rand.go @@ -346,7 +346,7 @@ func Float32() float32 { return globalRand.Float32() } func Perm(n int) []int { return globalRand.Perm(n) } // Shuffle pseudo-randomizes the order of elements using the default Source. -// n is the number of elements. Shuffle panics if n <= 0. +// n is the number of elements. Shuffle panics if n < 0. // swap swaps the elements with indexes i and j. func Shuffle(n int, swap func(i, j int)) { globalRand.Shuffle(n, swap) }