]> Cypherpunks repositories - gostls13.git/commit
math/rand: fix io.Reader implementation
authorDmitri Popov <operator@cv.dp-net.com>
Mon, 20 Jun 2016 03:58:40 +0000 (20:58 -0700)
committerAndrew Gerrand <adg@golang.org>
Mon, 27 Jun 2016 22:18:09 +0000 (22:18 +0000)
commit8d966bad6e4e9e28295bccbd739bf5280f729a7b
tree3ff880e3760a1aa0ec84baccd868769bf7dbafdf
parent0ce100dc9646eb9015e31502e184e45605df1393
math/rand: fix io.Reader implementation

Do not throw away the rest of Int63 value used for
generation random bytes. Save it in Rand struct and
re-use during the next Read call.

Fixes #16124

Change-Id: Ic70bd80c3c3a6590e60ac615e8b3c2324589bea3
Reviewed-on: https://go-review.googlesource.com/24251
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Joe Tsai <thebrokentoaster@gmail.com>
Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/math/rand/rand.go
src/math/rand/rand_test.go
src/math/rand/regress_test.go