mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[stdlib] Remove theGlobalMT19937
SwiftPrivate/PRNG.swift: - currently uses `theGlobalMT19937`; - previously used `arc4random` (see #1939); - is obsoleted by SE-0202: Random Unification.
This commit is contained in:
@@ -134,8 +134,9 @@ struct A<T> : MutableCollection, RandomAccessCollection {
|
||||
}
|
||||
|
||||
func randomArray() -> A<Int> {
|
||||
let count = Int(rand32(exclusiveUpperBound: 50))
|
||||
return A(randArray(count))
|
||||
let count = Int.random(in: 0 ..< 50)
|
||||
let array = (0 ..< count).map { _ in Int.random(in: .min ... .max) }
|
||||
return A(array)
|
||||
}
|
||||
|
||||
Algorithm.test("invalidOrderings") {
|
||||
|
||||
Reference in New Issue
Block a user