We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a0417e commit 2be65b4Copy full SHA for 2be65b4
Boyer-Moore/BoyerMoore.swift
@@ -61,7 +61,7 @@ extension String {
61
// pattern, we can skip ahead by the full pattern length. However, if
62
// the character *is* present in the pattern, there may be a match up
63
// ahead and we can't skip as far.
64
- i = self.index(i, offsetBy: skipTable[c] ?? patternLength)
+ i = index(i, offsetBy: skipTable[c] ?? patternLength, limitedBy: endIndex) ?? endIndex
65
}
66
67
return nil
0 commit comments