Skip to content

Commit 061cd18

Browse files
committed
Merge pull request #777 from PatrickPijnappel/patch-5
[stdlib] Fix comments
2 parents fc9887f + f181a6e commit 061cd18

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

stdlib/public/core/IntegerParsing.swift.gyb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ internal func _parseAsciiAsUIntMax(
8080
else { return nil }
8181
// Disallow < 0.
8282
if hasMinus && result != 0 { return nil }
83-
// Return.
83+
8484
return result
8585
}
8686

@@ -97,12 +97,12 @@ internal func _parseAsciiAsIntMax(
9797
if utf16.isEmpty { return nil }
9898
// Parse (optional) sign.
9999
let (digitsUTF16, hasMinus) = _parseOptionalAsciiSign(utf16)
100-
// Parse digits. +1 for because e.g. Int8's range is -128...127.
100+
// Parse digits. +1 for negatives because e.g. Int8's range is -128...127.
101101
let absValueMax = UIntMax(bitPattern: maximum) + (hasMinus ? 1 : 0)
102102
guard let absValue =
103103
_parseUnsignedAsciiAsUIntMax(digitsUTF16, radix, absValueMax)
104104
else { return nil }
105-
// Return signed result.
105+
// Convert to signed.
106106
return IntMax(bitPattern: hasMinus ? 0 &- absValue : absValue)
107107
}
108108

0 commit comments

Comments
 (0)