This commit is contained in:
Sean Owen 2021-10-07 21:31:16 -05:00
parent b51346c072
commit af7831b5c7

View file

@ -410,20 +410,12 @@ public final class HighLevelEncoder {
* @return the requested character count * @return the requested character count
*/ */
public static int determineConsecutiveDigitCount(CharSequence msg, int startpos) { public static int determineConsecutiveDigitCount(CharSequence msg, int startpos) {
int count = 0;
int len = msg.length(); int len = msg.length();
int idx = startpos; int idx = startpos;
if (idx < len) { while (idx < len && isDigit(msg.charAt(idx))) {
char ch = msg.charAt(idx);
while (isDigit(ch) && idx < len) {
count++;
idx++; idx++;
if (idx < len) {
ch = msg.charAt(idx);
} }
} return idx - startpos;
}
return count;
} }
static void illegalCharacter(char c) { static void illegalCharacter(char c) {