File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed
mug/src/main/java/com/google/mu/util Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change 1717import static com .google .mu .util .InternalCollectors .toImmutableList ;
1818import static com .google .mu .util .stream .MoreStreams .whileNotNull ;
1919import static java .lang .Math .max ;
20+ import static java .lang .Math .min ;
2021import static java .util .Comparator .comparingInt ;
2122import static java .util .Objects .requireNonNull ;
2223import static java .util .regex .Pattern .compile ;
@@ -3146,11 +3147,12 @@ private Pattern look(Predicate<Match> condition) {
31463147 Last original = this ;
31473148 return new Last () {
31483149 @ Override Match match (String input , int fromIndex , int endIndex ) {
3149- for (int i = endIndex ; i >= fromIndex ; i -- ) {
3150+ for (int i = endIndex ; i >= fromIndex ; ) {
31503151 Match match = original .match (input , fromIndex , i );
31513152 if (match == null || condition .test (match )) {
31523153 return match ;
31533154 }
3155+ i = min (match .endIndex - 1 , i - 1 );
31543156 }
31553157 return null ;
31563158 }
You can’t perform that action at this time.
0 commit comments