Skip to content

Commit 51ab0c7

Browse files
authored
More efficient writing of lists with Scala 3
1 parent 247bd60 commit 51ab0c7

File tree

1 file changed

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

1 file changed

+2
-1
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2934,8 +2934,9 @@ object JsonCodecMaker {
29342934
val tx = x.asExprOf[List[t1]]
29352935
'{
29362936
$out.writeArrayStart()
2937+
val n = Nil
29372938
var l = $tx
2938-
while (l ne Nil) {
2939+
while (l ne n) {
29392940
${genWriteVal('{ l.head }, tpe1 :: types, isStringified, None, out)}
29402941
l = l.tail
29412942
}

0 commit comments

Comments
 (0)