Skip to content

Commit 9286b36

Browse files
authored
Merge pull request #17604 from Azoy/moar-random-improvements
[stdlib] Remove _random() customization point
2 parents 0a46b4b + 04a16df commit 9286b36

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

stdlib/public/core/Integers.swift.gyb

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2421,10 +2421,6 @@ ${operatorComment(x.operator, False)}
24212421
${assignmentOperatorComment(x.operator, False)}
24222422
static func ${x.operator}=(_ lhs: inout Self, _ rhs: Self)
24232423
% end
2424-
2425-
static func _random<R: RandomNumberGenerator>(
2426-
using generator: inout R
2427-
) -> Self
24282424
}
24292425

24302426
extension FixedWidthInteger {
@@ -2962,6 +2958,7 @@ ${assignmentOperatorComment('&' + x.operator, True)}
29622958
}
29632959

29642960
extension FixedWidthInteger {
2961+
@inlinable
29652962
public static func _random<R: RandomNumberGenerator>(
29662963
using generator: inout R
29672964
) -> Self {
@@ -3972,17 +3969,6 @@ public func _assumeNonNegative(_ x: ${Self}) -> ${Self} {
39723969
}
39733970
% end
39743971

3975-
extension ${Self} {
3976-
@inlinable
3977-
public static func _random<R: RandomNumberGenerator>(
3978-
using generator: inout R
3979-
) -> ${Self} {
3980-
var result: ${Self} = 0
3981-
withUnsafeMutableBytes(of: &result) { generator._fill(bytes: $0) }
3982-
return result
3983-
}
3984-
}
3985-
39863972
//===--- end of FIXME(integers) -------------------------------------------===//
39873973

39883974
% end # end of concrete FixedWidthInteger section

0 commit comments

Comments
 (0)