@@ -1780,7 +1780,9 @@ final class JsonWriter private[jsoniter_scala](
1780
1780
var hours = 0L
1781
1781
var secsOfHour = effectiveTotalSecs.toInt
1782
1782
if (effectiveTotalSecs >= 3600 ) {
1783
- hours = effectiveTotalSecs / 3600
1783
+ hours =
1784
+ if (effectiveTotalSecs >= 4503599627370496L ) effectiveTotalSecs / 3600
1785
+ else (effectiveTotalSecs * 2.777777777777778E-4 ).toLong
1784
1786
secsOfHour = (effectiveTotalSecs - (hours << 12 ) + (hours << 9 ) - (hours << 4 )).toInt // (effectiveTotalSecs - hours * 3600).toInt
1785
1787
}
1786
1788
val minutes = secsOfHour * 17477 >> 20 // divide a small positive int by 60
@@ -1797,7 +1799,7 @@ final class JsonWriter private[jsoniter_scala](
1797
1799
lastPos += digitCount(q)
1798
1800
pos = lastPos
1799
1801
} else {
1800
- q = (( hours >>> 8 ) * 2.56e-6 ).toInt // divide a medium positive long by 100000000
1802
+ q = (hours * 1e-8 ).toInt // divide a medium positive long by 100000000
1801
1803
lastPos += digitCount(q)
1802
1804
pos = write8Digits((hours - q * 100000000L ).toInt, lastPos, buf, ds)
1803
1805
}
@@ -2641,6 +2643,7 @@ final class JsonWriter private[jsoniter_scala](
2641
2643
else if (x < 100000000 ) (9999999 - x >>> 31 ) + 7
2642
2644
else (999999999 - x >>> 31 ) + 9
2643
2645
2646
+ @ inline
2644
2647
private [this ] def writeSignificantFractionDigits (x : Long , p : Int , pl : Int , buf : Array [Byte ], ds : Array [Short ]): Int = {
2645
2648
var q0 = x.toInt
2646
2649
var pos = p
@@ -2661,6 +2664,7 @@ final class JsonWriter private[jsoniter_scala](
2661
2664
writeSignificantFractionDigits(q0, pos, posLim, buf, ds)
2662
2665
}
2663
2666
2667
+ @ inline
2664
2668
private [this ] def writeSignificantFractionDigits (q : Int , p : Int , posLim : Int , buf : Array [Byte ], ds : Array [Short ]): Int = {
2665
2669
var q0 = q
2666
2670
var q1, r1 = 0
@@ -2684,6 +2688,7 @@ final class JsonWriter private[jsoniter_scala](
2684
2688
lastPos
2685
2689
}
2686
2690
2691
+ @ inline
2687
2692
private [this ] def writeFractionDigits (q : Int , p : Int , posLim : Int , buf : Array [Byte ], ds : Array [Short ]): Unit = {
2688
2693
var q0 = q
2689
2694
var pos = p
0 commit comments