Skip to content

Commit

Permalink
feat: update shuffle to new random shuffle
Browse files Browse the repository at this point in the history
  • Loading branch information
wintermi committed Aug 11, 2023
1 parent 8782b3e commit 2dbba1f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions queries.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ func (queries *Queries) LoadQueries(inputPath string, outputPath string) error {
// Shuffle the Query Execution Order
func (queries *Queries) ShuffleExecutionOrder(shuffle bool) {
if shuffle {
rand.Seed(time.Now().UnixNano())
rand.Shuffle(len(queries.ExecutionOrder), func(i, j int) {
r := rand.New(rand.NewSource(time.Now().UnixNano()))
r.Shuffle(len(queries.ExecutionOrder), func(i, j int) {
queries.ExecutionOrder[i], queries.ExecutionOrder[j] = queries.ExecutionOrder[j], queries.ExecutionOrder[i]
})

Expand Down

0 comments on commit 2dbba1f

Please sign in to comment.