Skip to content

Commit 1b2f124

Browse files
authored
More efficient reading of BitSet values with Scala 2
1 parent 1f8d6e2 commit 1b2f124

File tree

1 file changed

+1
-1
lines changed
  • jsoniter-scala-macros/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/macros

1 file changed

+1
-1
lines changed

jsoniter-scala-macros/shared/src/main/scala-2/com/github/plokhotnyuk/jsoniter_scala/macros/JsonCodecMaker.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1649,7 +1649,7 @@ object JsonCodecMaker {
16491649
if (v < 0 || v >= ${cfg.bitSetValueLimit}) in.decodeError("illegal value for bit set")
16501650
val i = v >>> 6
16511651
if (i >= x.length) x = _root_.java.util.Arrays.copyOf(x, _root_.java.lang.Integer.highestOneBit(i) << 1)
1652-
x(i) |= 1L << v""",
1652+
x(i) = x(i) | 1L << v""",
16531653
if (tpe <:< typeOf[mutable.BitSet]) q"_root_.scala.collection.mutable.BitSet.fromBitMaskNoCopy(x)"
16541654
else q"_root_.scala.collection.immutable.BitSet.fromBitMaskNoCopy(x)")
16551655
} else if (tpe <:< typeOf[mutable.Set[_] with mutable.Builder[_, _]]) withDecoderFor(methodKey, default) {

0 commit comments

Comments
 (0)