Commit 163cbe5
committed
Work around word breaking issue
Given a particular input string and index, the _wordIndex(after:)
method can erroneously return an index before its parameter.
This change handles that case correctly, by detecting when we're
updating the word break cache with a previously cached index.1 parent 3d2bdaa commit 163cbe5
File tree
2 files changed
+20
-1
lines changed- Sources/_StringProcessing/Unicode
- Tests/RegexBuilderTests
2 files changed
+20
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
91 | 94 | | |
92 | 95 | | |
93 | 96 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1946 | 1946 | | |
1947 | 1947 | | |
1948 | 1948 | | |
| 1949 | + | |
| 1950 | + | |
| 1951 | + | |
| 1952 | + | |
| 1953 | + | |
| 1954 | + | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
1949 | 1965 | | |
1950 | 1966 | | |
1951 | 1967 | | |
| |||
0 commit comments