@@ -73,14 +73,14 @@ internal func _parseAsciiAsUIntMax(
73
73
utf16: String.UTF16View, _ radix: Int, _ maximum: UIntMax
74
74
) -> UIntMax? {
75
75
if utf16.isEmpty { return nil }
76
- // Parse (optional) sign
76
+ // Parse (optional) sign.
77
77
let (digitsUTF16, hasMinus) = _parseOptionalAsciiSign(utf16)
78
- // Parse digits
78
+ // Parse digits.
79
79
guard let result = _parseUnsignedAsciiAsUIntMax(digitsUTF16, radix, maximum)
80
80
else { return nil }
81
- // Disallow < 0
81
+ // Disallow < 0.
82
82
if hasMinus && result != 0 { return nil }
83
- // Return
83
+ // Return.
84
84
return result
85
85
}
86
86
@@ -95,14 +95,14 @@ internal func _parseAsciiAsIntMax(
95
95
) -> IntMax? {
96
96
_sanityCheck(maximum >= 0, "maximum should be non-negative")
97
97
if utf16.isEmpty { return nil }
98
- // Parse (optional) sign
98
+ // Parse (optional) sign.
99
99
let (digitsUTF16, hasMinus) = _parseOptionalAsciiSign(utf16)
100
- // Parse digits. +1 for negatives because e.g. Int8's range is -128...127.
100
+ // Parse digits. +1 for because e.g. Int8's range is -128...127.
101
101
let absValueMax = UIntMax(bitPattern: maximum) + (hasMinus ? 1 : 0)
102
102
guard let absValue =
103
103
_parseUnsignedAsciiAsUIntMax(digitsUTF16, radix, absValueMax)
104
104
else { return nil }
105
- // Return signed result
105
+ // Return signed result.
106
106
return IntMax(bitPattern: hasMinus ? 0 &- absValue : absValue)
107
107
}
108
108
0 commit comments