Skip to content

Commit bbd44a1

Browse files
Replace two #ifs with #if/#else in new integer random algorithm (#25352)
Swift gets used on archs other than 32 and 64b Intel and ARM (e.g. IBM's systems); as written this would fail to compile there.
1 parent 6ee5774 commit bbd44a1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

stdlib/public/core/Random.swift

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,7 @@ extension RandomNumberGenerator {
104104
} while random < range
105105

106106
return random % upperBound
107-
#endif
108-
#if arch(x86_64) || arch(arm64)
107+
#else
109108
var random: T = next()
110109
var m = random.multipliedFullWidth(by: upperBound)
111110
if m.low < upperBound {

0 commit comments

Comments
 (0)