Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Normative] Fix off-by-1 error in PartitionPattern
Right now after the loop finishes, the remainder is `pattern.substring(nextIndex + 1, len)` (bc it's exclusive) but should be `pattern.substring(nextIndex, len)` instead since `nextIndex` is already set to `endIndex + 1` in the loop. Take `AA{0}BB` as an example, after the loop finishes: - beginIndex = -1 - endIndex = 4 - nextIndex = 5 so `pattern.substring(5, 7)` yields `BB` (correct) vs the old behavior would just yield `B`
- Loading branch information