fix for issue 64 (Math.max -> Math.min)

This commit is contained in:
Grahame Grieve 2019-07-29 14:29:37 +10:00
parent 76cb23f21a
commit 51ac15da5b
2 changed files with 2 additions and 2 deletions

View File

@ -145,7 +145,7 @@ public abstract class FormatUtilities {
}
private static int firstIndexOf(byte[] source, char c, int scanLength) {
for (int i = 0; i < Math.max(source.length, scanLength); i++) {
for (int i = 0; i < Math.min(source.length, scanLength); i++) {
if (source[i] == c)
return i;
}

View File

@ -139,7 +139,7 @@ public abstract class FormatUtilities {
}
private static int firstIndexOf(byte[] source, char c, int scanLength) {
for (int i = 0; i < Math.max(source.length, scanLength); i++) {
for (int i = 0; i < Math.min(source.length, scanLength); i++) {
if (source[i] == c)
return i;
}