Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
plokhotnyuk committed Dec 13, 2024
1 parent f1c79c4 commit 8f6c06d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2571,15 +2571,15 @@ final class JsonReader private[jsoniter_scala](
if (s != 0) x1 = -x1
BigInt(x1)
} else new BigInt({
if (len <= 36) toBigDecimal36(buf, from, pos, s, 0).unscaledValue()
if (len <= 36) toBigDecimal36(buf, from, pos, s, 0).unscaledValue
else if (len <= 308) toBigInteger308(buf, from, pos, s)
else {
// Based on the great idea of Eric Obermühlner to use a tree of smaller BigDecimals for parsing huge numbers
// with O(n^1.5) complexity instead of O(n^2) when using the constructor for the decimal representation from JDK:
// https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f
val mid = len >> 1
val midPos = pos - mid
toBigDecimal(buf, from, midPos, s, -mid).add(toBigDecimal(buf, midPos, pos, s, 0)).unscaledValue()
toBigDecimal(buf, from, midPos, s, -mid).add(toBigDecimal(buf, midPos, pos, s, 0)).unscaledValue
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2543,7 +2543,7 @@ final class JsonReader private[jsoniter_scala](
// https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f
val mid = len >> 1
val midPos = pos - mid
toBigDecimal(buf, from, midPos, s, -mid).add(toBigDecimal(buf, midPos, pos, s, 0)).unscaledValue()
toBigDecimal(buf, from, midPos, s, -mid).add(toBigDecimal(buf, midPos, pos, s, 0)).unscaledValue
}
})
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2540,7 +2540,7 @@ final class JsonReader private[jsoniter_scala](
// https://github.com/eobermuhlner/big-math/commit/7a5419aac8b2adba2aa700ccf00197f97b2ad89f
val mid = len >> 1
val midPos = pos - mid
toBigDecimal(buf, from, midPos, s, -mid).add(toBigDecimal(buf, midPos, pos, s, 0)).unscaledValue()
toBigDecimal(buf, from, midPos, s, -mid).add(toBigDecimal(buf, midPos, pos, s, 0)).unscaledValue
}
})
}
Expand Down

0 comments on commit 8f6c06d

Please sign in to comment.