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 7af435c commit 68a2a2cCopy full SHA for 68a2a2c
stdlib/public/core/Collection.swift
@@ -929,7 +929,7 @@ extension Collection {
929
using generator: inout T
930
) -> Element? {
931
guard !isEmpty else { return nil }
932
- let random = Int.random(in: 0 ..< count)
+ let random = Int.random(in: 0 ..< count, using: &generator)
933
let idx = index(
934
startIndex,
935
offsetBy: random
stdlib/public/core/CollectionAlgorithms.swift
@@ -449,7 +449,7 @@ extension MutableCollection where Self : RandomAccessCollection {
449
var amount = count
450
var currentIndex = startIndex
451
while amount > 1 {
452
- let random = Int.random(in: 0 ..< amount)
+ let random = Int.random(in: 0 ..< amount, using: &generator)
453
amount -= 1
454
swapAt(
455
currentIndex,
0 commit comments