Skip to content

Commit 9e2439e

Browse files
committed
More efficient reading of Long values with Scala.js
1 parent 231dd2f commit 9e2439e

File tree

1 file changed

+1
-1
lines changed
  • jsoniter-scala-core/js/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core

1 file changed

+1
-1
lines changed

jsoniter-scala-core/js/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonReader.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2178,7 +2178,7 @@ final class JsonReader private[jsoniter_scala](
21782178
b >= '0' && b <= '9'
21792179
}) {
21802180
if (x < -922337203685477580L || {
2181-
x = x * 10 + ('0' - b)
2181+
x = (x << 3) + (x << 1) + ('0' - b)
21822182
x > 0
21832183
}) longOverflowError(pos)
21842184
pos += 1

0 commit comments

Comments
 (0)