Skip to content

Commit 3b4b6ee

Browse files
committed
Code clean up
1 parent 2d37d64 commit 3b4b6ee

File tree

1 file changed

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

1 file changed

+4
-4
lines changed

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

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1791,7 +1791,7 @@ final class JsonWriter private[jsoniter_scala](
17911791
lastPos += digitCount(q)
17921792
pos = lastPos
17931793
} else {
1794-
q = ((hours >>> 8) * 2.56e-6).toInt
1794+
q = ((hours >>> 8) * 2.56e-6).toInt // divide a medium positive long by 100000000
17951795
lastPos += digitCount(q)
17961796
pos = write8Digits((hours - q * 100000000L).toInt, lastPos, buf, ds)
17971797
}
@@ -2210,7 +2210,7 @@ final class JsonWriter private[jsoniter_scala](
22102210
}
22112211

22122212
private[this] def write18Digits(x: Long, pos: Int, buf: Array[Byte], ds: Array[Short]): Int = {
2213-
val q1 = ((x >>> 8) * 2.56e-6).toLong
2213+
val q1 = ((x >>> 8) * 2.56e-6).toLong // divide a medium positive long by 100000000
22142214
write8Digits((x - q1 * 100000000L).toInt, {
22152215
val q2 = (q1 >>> 8) * 1441151881L >>> 49 // divide a small positive long by 100000000
22162216
write8Digits((q1 - q2 * 100000000L).toInt, write2Digits(q2.toInt, pos, buf, ds), buf, ds)
@@ -2306,7 +2306,7 @@ final class JsonWriter private[jsoniter_scala](
23062306
buf(pos + 18) = (r + '0').toByte
23072307
posCorr = 1
23082308
}
2309-
val q1 = ((q0 >>> 8) * 2.56e-6).toLong // divide a positive long by 100000000
2309+
val q1 = ((q0 >>> 8) * 2.56e-6).toLong // divide a medium positive long by 100000000
23102310
q = q1.toInt
23112311
if (q1 == q) {
23122312
lastPos += digitCount(q)
@@ -2609,7 +2609,7 @@ final class JsonWriter private[jsoniter_scala](
26092609
var pos = p
26102610
var posLim = pl
26112611
if (q0 != x) {
2612-
val q1 = ((x >>> 8) * 2.56e-6).toInt // divide a positive long by 100000000
2612+
val q1 = ((x >>> 8) * 2.56e-6).toInt // divide a medium positive long by 100000000
26132613
val r1 = (x - q1 * 100000000L).toInt
26142614
val posm8 = pos - 8
26152615
if (r1 == 0) {

0 commit comments

Comments
 (0)