mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-12-23 01:37:37 +00:00
Minor improvement to MathMan#isInteger
This commit is contained in:
parent
7d3a9ff36d
commit
8928556c1d
@ -352,8 +352,18 @@ public class MathMan {
|
|||||||
if (str.charAt(0) == '-') {
|
if (str.charAt(0) == '-') {
|
||||||
if (length == 1) {
|
if (length == 1) {
|
||||||
return false;
|
return false;
|
||||||
|
//VERY basic check for >< int min/max value without spending time trying to parse the int
|
||||||
|
} else if (length > 11) {
|
||||||
|
return false;
|
||||||
|
} else if (length == 11 && str.charAt(0) > '2' && str.charAt(0) > '1') {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
i = 1;
|
i = 1;
|
||||||
|
//VERY basic check for >< int min/max value without spending time trying to parse the int
|
||||||
|
} else if (length > 10) {
|
||||||
|
return false;
|
||||||
|
} else if (length == 10 && str.charAt(0) > '2' && str.charAt(0) > '1') {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
for (; i < length; i++) {
|
for (; i < length; i++) {
|
||||||
char c = str.charAt(i);
|
char c = str.charAt(i);
|
||||||
|
Loading…
Reference in New Issue
Block a user