Skip to content

Commit 6a533ca

Browse files
committed
More efficient reading of java.time.Duration values with minutes using Scala.js
1 parent 2b50366 commit 6a533ca

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
@@ -2921,7 +2921,7 @@ final class JsonReader private[jsoniter_scala](
29212921
state = 1
29222922
} else if (b == 'M' && state <= 1) {
29232923
if (x < -153722867280912930L || x > 153722867280912930L) durationError(pos) // -153722867280912930L == Long.MinValue / 60
2924-
seconds = sumSeconds(x * 60, seconds, pos)
2924+
seconds = sumSeconds(((x << 4) - x) << 2, seconds, pos)
29252925
state = 2
29262926
} else if (b == 'S' || b == '.') {
29272927
seconds = sumSeconds(x, seconds, pos)

0 commit comments

Comments
 (0)