mirror of
https://gitee.com/johng/gf
synced 2026-06-07 02:12:11 +08:00
improve grand.Intn; README updates
This commit is contained in:
@ -66,6 +66,7 @@ func main() {
|
||||
|
||||
# Contributors
|
||||
|
||||
- [aloncn](https://github.com/aloncn)
|
||||
- [chenyang351](https://github.com/chenyang351)
|
||||
- [garfieldkwong](https://gitee.com/garfieldkwong)
|
||||
- [hailaz](https://gitee.com/hailaz)
|
||||
|
||||
@ -86,6 +86,7 @@ func main() {
|
||||
|
||||
# 贡献者
|
||||
|
||||
- [aloncn](https://github.com/aloncn)
|
||||
- [chenyang351](https://github.com/chenyang351)
|
||||
- [garfieldkwong](https://gitee.com/garfieldkwong)
|
||||
- [hailaz](https://gitee.com/hailaz)
|
||||
|
||||
@ -36,10 +36,15 @@ func init() {
|
||||
i ++
|
||||
}
|
||||
// 充分利用缓冲区数据,随机索引递增
|
||||
step = int(buffer[0])%10
|
||||
if step == 0 {
|
||||
step = 2
|
||||
for i := 0; i < n; i++ {
|
||||
step = int(buffer[0])%10
|
||||
if step != 0 {
|
||||
break
|
||||
}
|
||||
}
|
||||
if step == 0 {
|
||||
step = 2
|
||||
}
|
||||
for i := 0; i < n - 4; {
|
||||
bufferChan <- binary.BigEndian.Uint32(buffer[i : i + 4])
|
||||
i += step
|
||||
|
||||
Reference in New Issue
Block a user