private Result nextImpl ( int pos , int inUnit ) { int node = chars_ . charAt ( pos ++ ) ; for ( ; ; ) { if ( node < kMinLinearMatch ) { return branchNext ( pos , node , inUnit ) ; } else if ( node < kMinValueLead ) { // Match the first of length+1 units. int length = node - kMinLinearMatch ; // Actual match length minus 1. if ( inUnit == chars_ . charAt ( pos ++ ) ) { remainingMatchLength_ = -- length ; pos_ = pos ; return ( length < 0 && ( node = chars_ . charAt ( pos ) ) >= kMinValueLead ) ? valueResults_ [ node >> 15 ] : Result . NO_VALUE ; } else { // No match. break ; } } else if ( ( node & kValueIsFinal ) != 0 ) { // No further matching units. break ; } else { // Skip intermediate value. pos = skipNodeValue ( pos , node ) ; node &= kNodeTypeMask ; } } stop ( ) ; return Result . NO_MATCH ; }
Requires remainingLength_<0 .