4444import java .util .LinkedHashMap ;
4545import java .util .List ;
4646import java .util .Map ;
47- import java .util .function .Predicate ;
47+ import java .util .function .IntPredicate ;
4848
4949import org .graalvm .collections .EconomicSet ;
5050
@@ -557,7 +557,7 @@ protected boolean lookahead(String match) {
557557 return pattern .regionMatches (position , match , 0 , match .length ());
558558 }
559559
560- protected boolean lookahead (Predicate < Character > predicate , int length ) {
560+ protected boolean lookahead (IntPredicate predicate , int length ) {
561561 if (pattern .length () - position < length ) {
562562 return false ;
563563 }
@@ -588,7 +588,7 @@ protected boolean consumingLookahead(String match) {
588588 return matches ;
589589 }
590590
591- protected boolean consumingLookahead (Predicate < Character > predicate , int length ) {
591+ protected boolean consumingLookahead (IntPredicate predicate , int length ) {
592592 final boolean matches = lookahead (predicate , length );
593593 if (matches ) {
594594 position += length ;
@@ -603,19 +603,19 @@ protected boolean lookbehind(char c) {
603603 return pattern .charAt (position - 1 ) == c ;
604604 }
605605
606- protected int count (Predicate < Character > predicate ) {
606+ protected int count (IntPredicate predicate ) {
607607 return count (predicate , position , pattern .length ());
608608 }
609609
610- protected int countUpTo (Predicate < Character > predicate , int max ) {
610+ protected int countUpTo (IntPredicate predicate , int max ) {
611611 return count (predicate , position , (int ) Math .min (((long ) position ) + max , pattern .length ()));
612612 }
613613
614- protected int countFrom (Predicate < Character > predicate , int fromIndex ) {
614+ protected int countFrom (IntPredicate predicate , int fromIndex ) {
615615 return count (predicate , fromIndex , pattern .length ());
616616 }
617617
618- protected int count (Predicate < Character > predicate , int fromIndex , int toIndex ) {
618+ protected int count (IntPredicate predicate , int fromIndex , int toIndex ) {
619619 for (int i = fromIndex ; i < toIndex ; i ++) {
620620 if (!predicate .test (pattern .charAt (i ))) {
621621 return i - fromIndex ;
0 commit comments