mirror of
https://github.com/zxing/zxing.git
synced 2025-03-05 20:48:51 -08:00
Optimization for https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=39707
This commit is contained in:
parent
b51346c072
commit
af7831b5c7
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue