File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Sources/_StringProcessing/Engine Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -190,7 +190,7 @@ extension String {
190
190
limitedBy end: String . Index ,
191
191
isScalarSemantics: Bool
192
192
) -> QuickResult < String . Index ? > {
193
- guard currentPosition < end else { return . definite ( nil ) }
193
+ assert ( currentPosition < end)
194
194
guard let ( asciiValue, next, isCRLF) = _quickASCIICharacter (
195
195
at: currentPosition, limitedBy: end
196
196
) else {
@@ -273,7 +273,7 @@ extension String {
273
273
isStrictASCII: Bool ,
274
274
isScalarSemantics: Bool
275
275
) -> QuickResult < String . Index ? > {
276
- guard currentPosition < end else { return . definite ( nil ) }
276
+ assert ( currentPosition < end)
277
277
guard let ( next, result) = _quickMatch (
278
278
cc,
279
279
at: currentPosition,
@@ -336,7 +336,7 @@ extension String {
336
336
if isScalarSemantics {
337
337
matched = scalar. isNewline && asciiCheck
338
338
if matched && scalar == " \r "
339
- && next != end && unicodeScalars [ next] == " \n " {
339
+ && next < end && unicodeScalars [ next] == " \n " {
340
340
// Match a full CR-LF sequence even in scalar semantics
341
341
unicodeScalars. formIndex ( after: & next)
342
342
}
You can’t perform that action at this time.
0 commit comments