Skip to content

Commit 52e0351

Browse files
committed
Use UInt64.random instead of arc4random
1 parent ab8bc45 commit 52e0351

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Sources/CompletionScoringTestSupport/RepeatableRandomNumberGenerator.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@ package struct RepeatableRandomNumberGenerator: RandomNumberGenerator {
6060

6161
static func generateSeed() {
6262
let numbers: [UInt64] = (0..<1024).map { _ in
63-
let lo = UInt64(arc4random())
64-
let hi = UInt64(arc4random())
63+
let lo = UInt64.random(in: 0...UInt64.max)
64+
let hi = UInt64.random(in: 0...UInt64.max)
6565
return (hi << 32) | lo
6666
}
6767
let header =

Sources/CompletionScoringTestSupport/TestExtensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ extension XCTestCase {
4747
while elapsed < 1.0 {
4848
elapsed += duration {
4949
let integers = Array(count: integers) {
50-
arc4random()
50+
UInt64.random(in: 0...UInt64.max)
5151
}
5252
DispatchQueue.concurrentPerform(iterations: 128) { _ in
5353
integers.withUnsafeBytes { bytes in

0 commit comments

Comments
 (0)