Skip to content

Commit

Permalink
remove problematic bigint optimisation (FasterXML#987)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjfanning committed Apr 16, 2023
1 parent b6ce6b0 commit c4414c6
Showing 1 changed file with 1 addition and 8 deletions.
9 changes: 1 addition & 8 deletions src/main/java/com/fasterxml/jackson/core/io/NumberInput.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@

public final class NumberInput
{
// numbers with more than these characters are better parsed with BigDecimalParser
// parsing numbers with many digits in Java is slower than O(n)
private final static int LARGE_INT_SIZE = 1250;

/**
* Formerly used constant for a value that was problematic on certain
* pre-1.8 JDKs.
Expand Down Expand Up @@ -398,10 +394,7 @@ public static BigDecimal parseBigDecimal(char[] ch) throws NumberFormatException
* @throws NumberFormatException if string cannot be represented by a BigInteger
* @since v2.14
*/
public static BigInteger parseBigInteger(String s) throws NumberFormatException {
if (s.length() > LARGE_INT_SIZE) {
return BigDecimalParser.parse(s).toBigInteger();
}
public static BigInteger parseBigInteger(final String s) throws NumberFormatException {
return new BigInteger(s);
}
}

0 comments on commit c4414c6

Please sign in to comment.