Skip to content

Commit 2be65b4

Browse files
committed
Fix failing test.
1 parent 7a0417e commit 2be65b4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Boyer-Moore/BoyerMoore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ extension String {
6161
// pattern, we can skip ahead by the full pattern length. However, if
6262
// the character *is* present in the pattern, there may be a match up
6363
// ahead and we can't skip as far.
64-
i = self.index(i, offsetBy: skipTable[c] ?? patternLength)
64+
i = index(i, offsetBy: skipTable[c] ?? patternLength, limitedBy: endIndex) ?? endIndex
6565
}
6666
}
6767
return nil

0 commit comments

Comments
 (0)