use_Math_max_min (#547)
This commit is contained in:
parent
34fcd18ae7
commit
9078cdc8c4
|
@ -6523,7 +6523,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
boolean tmp;
|
||||
while (j > i) {
|
||||
|
@ -6570,7 +6570,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
byte tmp;
|
||||
while (j > i) {
|
||||
|
@ -6617,7 +6617,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
char tmp;
|
||||
while (j > i) {
|
||||
|
@ -6664,7 +6664,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
double tmp;
|
||||
while (j > i) {
|
||||
|
@ -6711,7 +6711,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
float tmp;
|
||||
while (j > i) {
|
||||
|
@ -6758,7 +6758,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
int tmp;
|
||||
while (j > i) {
|
||||
|
@ -6805,7 +6805,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
long tmp;
|
||||
while (j > i) {
|
||||
|
@ -6856,7 +6856,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
Object tmp;
|
||||
while (j > i) {
|
||||
|
@ -6903,7 +6903,7 @@ public static int indexOf(final int[] array, final int valueToFind) {
|
|||
if (array == null) {
|
||||
return;
|
||||
}
|
||||
int i = startIndexInclusive < 0 ? 0 : startIndexInclusive;
|
||||
int i = Math.max(startIndexInclusive, 0);
|
||||
int j = Math.min(array.length, endIndexExclusive) - 1;
|
||||
short tmp;
|
||||
while (j > i) {
|
||||
|
|
|
@ -1534,7 +1534,7 @@ public class Conversion {
|
|||
if (nBytes > 16) {
|
||||
throw new IllegalArgumentException("nBytes is greater than 16");
|
||||
}
|
||||
longToByteArray(src.getMostSignificantBits(), 0, dst, dstPos, nBytes > 8 ? 8 : nBytes);
|
||||
longToByteArray(src.getMostSignificantBits(), 0, dst, dstPos, Math.min(nBytes, 8));
|
||||
if (nBytes >= 8) {
|
||||
longToByteArray(src.getLeastSignificantBits(), 0, dst, dstPos + 8, nBytes - 8);
|
||||
}
|
||||
|
|
|
@ -2420,7 +2420,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
|
|||
* @return the first index of the character, or -1 if not found
|
||||
*/
|
||||
public int indexOf(final char ch, int startIndex) {
|
||||
startIndex = (startIndex < 0 ? 0 : startIndex);
|
||||
startIndex = (Math.max(startIndex, 0));
|
||||
if (startIndex >= size) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -2456,7 +2456,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
|
|||
* @return the first index of the string, or -1 if not found
|
||||
*/
|
||||
public int indexOf(final String str, int startIndex) {
|
||||
startIndex = (startIndex < 0 ? 0 : startIndex);
|
||||
startIndex = (Math.max(startIndex, 0));
|
||||
if (str == null || startIndex >= size) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -2511,7 +2511,7 @@ public class StrBuilder implements CharSequence, Appendable, Serializable, Build
|
|||
* @return the first index matched, or -1 if not found
|
||||
*/
|
||||
public int indexOf(final StrMatcher matcher, int startIndex) {
|
||||
startIndex = (startIndex < 0 ? 0 : startIndex);
|
||||
startIndex = (Math.max(startIndex, 0));
|
||||
if (matcher == null || startIndex >= size) {
|
||||
return -1;
|
||||
}
|
||||
|
|
|
@ -214,7 +214,7 @@ public class FastDatePrinter implements DatePrinter, Serializable {
|
|||
if (tokenLen == 2) {
|
||||
rule = TwoDigitYearField.INSTANCE;
|
||||
} else {
|
||||
rule = selectNumberRule(Calendar.YEAR, tokenLen < 4 ? 4 : tokenLen);
|
||||
rule = selectNumberRule(Calendar.YEAR, Math.max(tokenLen, 4));
|
||||
}
|
||||
if (c == 'Y') {
|
||||
rule = new WeekYear((NumberRule) rule);
|
||||
|
|
Loading…
Reference in New Issue