Skip to content

Commit

Permalink
feat: Updated utils/random.go
Browse files Browse the repository at this point in the history
  • Loading branch information
sweep-ai[bot] committed Dec 9, 2023
1 parent 4de6bfd commit c68088c
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion utils/random.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ var (

func Init() {
go func() {
batch := make([]int, 1024)
for {
randCh <- int(src.Int63() % int64(validNameRunesLen))
for i := range batch {
batch[i] = int(src.Int63() % int64(validNameRunesLen))
}
for _, num := range batch {
randCh <- num
}
}
}()
}
Expand Down

0 comments on commit c68088c

Please sign in to comment.