We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e3cb76b commit 5d2f798Copy full SHA for 5d2f798
util.go
@@ -9,12 +9,12 @@ import (
9
10
// fastrand is a fast thread local random function.
11
//
12
-//go:linkname fastrand runtime.fastrand
13
-func fastrand() uint32
+//go:linkname fastrandn runtime.fastrandn
+func fastrandn(n uint32) uint32
14
15
// randi returns either i1 or i2 randomly.
16
func randi(i1, i2 uint) uint {
17
- if fastrand()%2 == 0 {
+ if fastrandn(2) == 0 {
18
return i1
19
}
20
return i2
0 commit comments