[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:
Ben Rimmington
2018-07-10 12:52:36 +01:00
parent 767685520e
commit 2f326bcc88
16 changed files with 56 additions and 181 deletions

View File

@@ -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") {