Merge pull request #988 from stleary/remove-unused-code-jsonobject

removed unused method from jsonobject
This commit is contained in:
Sean Leary 2025-06-16 11:34:35 -05:00 committed by GitHub
commit 32e56da786
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -3013,24 +3013,4 @@ public class JSONObject {
"JavaBean object contains recursively defined member variable of key " + quote(key)
);
}
/**
* For a prospective number, remove the leading zeros
* @param value prospective number
* @return number without leading zeros
*/
private static String removeLeadingZerosOfNumber(String value){
if ("-".equals(value)){return value;}
boolean negativeFirstChar = (value.charAt(0) == '-');
int counter = negativeFirstChar ? 1:0;
while (counter < value.length()){
if (value.charAt(counter) != '0'){
if (negativeFirstChar) {return "-".concat(value.substring(counter));}
return value.substring(counter);
}
++counter;
}
if (negativeFirstChar) {return "-0";}
return "0";
}
}