Skip to content

Commit ebad4bb

Browse files
committed
[stdlib] Specialize FixedWidthInteger.init(_:radix:).
1 parent cc8a351 commit ebad4bb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

stdlib/public/core/IntegerParsing.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ internal func _parseASCIIDigits<
7272
// N.B.: This free function is a manually specialized version of the function
7373
// above. Ensure that any changes are made in sync.
7474
@_alwaysEmitIntoClient
75-
@inline(never)
7675
internal func _parseASCIIDigits<Result: FixedWidthInteger>(
7776
_ codeUnits: UnsafeBufferPointer<UInt8>, radix: Int, isNegative: Bool
7877
) -> Result? {
@@ -144,7 +143,6 @@ internal func _parseASCII<UTF8CodeUnits: Collection, Result: FixedWidthInteger>(
144143
}
145144

146145
@_alwaysEmitIntoClient
147-
@inline(never)
148146
internal func _parseASCII<Result: FixedWidthInteger>(
149147
_ codeUnits: UnsafeBufferPointer<UInt8>, radix: Int
150148
) -> Result? {
@@ -197,7 +195,8 @@ extension FixedWidthInteger {
197195
/// - radix: The radix, or base, to use for converting `text` to an integer
198196
/// value. `radix` must be in the range `2...36`. The default is 10.
199197
@inlinable
200-
@inline(__always)
198+
@_specialize(kind: partial, where S == String)
199+
@_specialize(kind: partial, where S == Substring)
201200
public init?<S: StringProtocol>(_ text: S, radix: Int = 10) {
202201
_precondition(2...36 ~= radix, "Radix not in range 2...36")
203202
guard _fastPath(!text.isEmpty) else { return nil }

0 commit comments

Comments
 (0)