Performance pass 6 (Wrapper type may be primitive)

This commit is contained in:
Andrew 2020-10-15 22:46:25 -07:00
parent d9d0f426e4
commit dba07c1832
2 changed files with 6 additions and 6 deletions

View File

@ -876,7 +876,7 @@ public class Form
*/ */
public static String ofSize(long s, int div) public static String ofSize(long s, int div)
{ {
Double d = (double) s; double d = (double) s;
String sub = "Bytes"; String sub = "Bytes";
if(d > div - 1) if(d > div - 1)
@ -929,7 +929,7 @@ public class Form
*/ */
public static String ofSize(long s, int div, int dec) public static String ofSize(long s, int div, int dec)
{ {
Double d = (double) s; double d = (double) s;
String sub = "Bytes"; String sub = "Bytes";
if(d > div - 1) if(d > div - 1)
@ -979,7 +979,7 @@ public class Form
{ {
s = -s; s = -s;
} }
Double d = (double) s; double d = (double) s;
String sub = "Grams"; String sub = "Grams";
if(d > div - 1) if(d > div - 1)

View File

@ -1652,7 +1652,7 @@ public class JSONObject
*/ */
public static Object stringToValue(String string) public static Object stringToValue(String string)
{ {
Double d; double d;
if(string.equals("")) if(string.equals(""))
{ {
return string; return string;
@ -1682,8 +1682,8 @@ public class JSONObject
{ {
if(string.indexOf('.') > -1 || string.indexOf('e') > -1 || string.indexOf('E') > -1) if(string.indexOf('.') > -1 || string.indexOf('e') > -1 || string.indexOf('E') > -1)
{ {
d = Double.valueOf(string); d = Double.parseDouble(string);
if(!d.isInfinite() && !d.isNaN()) if(!Double.isInfinite(d) && !Double.isNaN(d))
{ {
return d; return d;
} }