Skip to content

Commit 612d622

Browse files
committed
More efficient reading of java.time.Duration values using Scala.js
1 parent 57dac73 commit 612d622

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
@@ -2917,7 +2917,7 @@ final class JsonReader private[jsoniter_scala](
29172917
state = 0
29182918
} else if (b == 'H' && state <= 0) {
29192919
if (x < -2562047788015215L || x > 2562047788015215L) durationError(pos) // -2562047788015215L == Long.MinValue / 3600
2920-
seconds = sumSeconds(x * 3600, seconds, pos)
2920+
seconds = sumSeconds((x << 12) - (x << 9) + (x << 4), seconds, pos)
29212921
state = 1
29222922
} else if (b == 'M' && state <= 1) {
29232923
if (x < -153722867280912930L || x > 153722867280912930L) durationError(pos) // -153722867280912930L == Long.MinValue / 60

0 commit comments

Comments
 (0)