Skip to content

Commit

Permalink
Code clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
plokhotnyuk committed Oct 24, 2024
1 parent 5778631 commit a003b18
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,6 @@ final class JsonWriter private[jsoniter_scala](
*/
def writeArrayStart(): Unit = writeNestedStart('[')


/**
* Writes a JSON array end marker (`]`).
*/
Expand Down Expand Up @@ -1622,10 +1621,9 @@ final class JsonWriter private[jsoniter_scala](
pos += digitCount(q)
count = pos
} else {
val q1 = (exp >>> 8) * 1441151881L >>> 49 // divide a small positive long by 100000000
q = q1.toInt
pos += digitCount(q)
count = write8Digits((exp - q1 * 100000000L).toInt, pos, buf, ds)
q = (exp * 1e-8).toInt // divide a small positive long by 100000000
pos += ((9 - q) >>> 31) + 1
count = write8Digits((exp - q * 100000000L).toInt, pos, buf, ds)
}
writePositiveIntDigits(q, pos, buf, ds)
}
Expand Down Expand Up @@ -2403,10 +2401,9 @@ final class JsonWriter private[jsoniter_scala](
lastPos += digitCount(q)
pos = lastPos
} else {
val q2 = (q1 >>> 8) * 1441151881L >>> 49 // divide a small positive long by 100000000
q = q2.toInt
lastPos += digitCount(q)
pos = write8Digits((q1 - q2 * 100000000L).toInt, lastPos, buf, ds)
q = ((q1 >>> 8) * 1441151881L >>> 49).toInt // divide a small positive long by 100000000
lastPos += ((9 - q) >>> 31) + 1
pos = write8Digits((q1 - q * 100000000L).toInt, lastPos, buf, ds)
}
pos = write8Digits((q0 - q1 * 100000000L).toInt, pos, buf, ds) + posCorr
}
Expand Down Expand Up @@ -2452,7 +2449,7 @@ final class JsonWriter private[jsoniter_scala](
cblCorr = 1
}
e10 = e2 * 315653 - e2Corr >> 20
val g = gs(e10 + 324 << 1) + 1
val g = gs(e10 + 324 << 1) + 1L
val h = (e10 * -108853 >> 15) + e2 + 1
val cb = m2 << 2
val vbCorr = (m2 & 0x1) - 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ final class JsonWriter private[jsoniter_scala](
*/
def writeArrayStart(): Unit = writeNestedStart('[')


/**
* Writes a JSON array end marker (`]`).
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ final class JsonWriter private[jsoniter_scala](
*/
def writeArrayStart(): Unit = writeNestedStart('[')


/**
* Writes a JSON array end marker (`]`).
*/
Expand Down

0 comments on commit a003b18

Please sign in to comment.