File tree Expand file tree Collapse file tree 3 files changed +23
-12
lines changed
js/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core
jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core
native/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core Expand file tree Collapse file tree 3 files changed +23
-12
lines changed Original file line number Diff line number Diff line change @@ -2802,11 +2802,13 @@ final class JsonReader private[jsoniter_scala](
2802
2802
pos += 9
2803
2803
first = Math .max(first - 1 , 0 )
2804
2804
var i = last
2805
- while (i >= first) {
2805
+ while ({
2806
2806
x += (magnitude(i) & 0xFFFFFFFFL) * 1000000000
2807
2807
magnitude(i) = x.toInt
2808
- x >>>= 32
2809
2808
i -= 1
2809
+ i >= first
2810
+ }) {
2811
+ x >>>= 32
2810
2812
}
2811
2813
}
2812
2814
val bs = new Array [Byte ](last + 1 << 2 )
Original file line number Diff line number Diff line change @@ -2847,13 +2847,18 @@ final class JsonReader private[jsoniter_scala](
2847
2847
first = Math .max(first - 8 , 0 )
2848
2848
var i = last
2849
2849
val q = 1000000000000000000L
2850
- while (i >= first) {
2851
- val m = ByteArrayAccess .getLong(magnitude, i)
2852
- val p = m * q
2853
- x += p
2850
+ var m, mq = 0L
2851
+ while ({
2852
+ m = ByteArrayAccess .getLong(magnitude, i)
2853
+ mq = m * q
2854
+ x += mq
2854
2855
ByteArrayAccess .setLong(magnitude, i, x)
2855
- x = Math .multiplyHigh(m, q) + (m >> 63 & q) + ((~ x & p) >>> 63 ) // FIXME: Use Math.unsignedMultiplyHigh after dropping of JDK 17 support
2856
2856
i -= 8
2857
+ i >= first
2858
+ }) {
2859
+ x = (~ x & mq) >>> 63
2860
+ x += Math .multiplyHigh(m, q)
2861
+ x += m >> 63 & q
2857
2862
}
2858
2863
}
2859
2864
var i = 0
Original file line number Diff line number Diff line change @@ -2844,13 +2844,17 @@ final class JsonReader private[jsoniter_scala](
2844
2844
first = Math .max(first - 8 , 0 )
2845
2845
var i = last
2846
2846
val q = 1000000000000000000L
2847
- while (i >= first) {
2848
- val m = ByteArrayAccess .getLong(magnitude, i)
2849
- val p = m * q
2850
- x += p
2847
+ var m, mq = 0L
2848
+ while ({
2849
+ m = ByteArrayAccess .getLong(magnitude, i)
2850
+ mq = m * q
2851
+ x += mq
2851
2852
ByteArrayAccess .setLong(magnitude, i, x)
2852
- x = NativeMath .unsignedMultiplyHigh(m, q) + ((~ x & p) >>> 63 )
2853
2853
i -= 8
2854
+ i >= first
2855
+ }) {
2856
+ x = (~ x & mq) >>> 63
2857
+ x += NativeMath .unsignedMultiplyHigh(m, q)
2854
2858
}
2855
2859
}
2856
2860
var i = 0
You can’t perform that action at this time.
0 commit comments