Skip to content

Commit

Permalink
More efficient decoding of case classes which have fields with defaul…
Browse files Browse the repository at this point in the history
…t values
  • Loading branch information
plokhotnyuk committed Feb 5, 2025
1 parent 506b8a8 commit 0c2ea3c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ lazy val zioJson = crossProject(JSPlatform, JVMPlatform, NativePlatform)
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((3, _)) =>
Seq(
"com.softwaremill.magnolia1_3" %%% "magnolia" % "1.3.10"
"com.softwaremill.magnolia1_3" %%% "magnolia" % "1.3.11"
)
case _ =>
Seq(
Expand Down
5 changes: 2 additions & 3 deletions zio-json/shared/src/main/scala-2.x/zio/json/macros.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import zio.json.internal.{ FieldEncoder, Lexer, RetractReader, StringMatrix, Wri

import scala.annotation._
import scala.language.experimental.macros
import scala.reflect.ClassTag

/**
* If used on a case class field, determines the name of the JSON field. Defaults to the case class field name.
Expand Down Expand Up @@ -659,8 +658,8 @@ object DeriveJsonEncoder {

// backcompat for 2.12, otherwise we'd use ArraySeq.unsafeWrapArray
private final class ArraySeq(p: Array[Any]) extends IndexedSeq[Any] {
def apply(i: Int): Any = p(i)
def length: Int = p.length
@inline def apply(i: Int): Any = p(i)
@inline def length: Int = p.length
}

// intercepts the first `{` of a nested writer and discards it. We also need to
Expand Down

0 comments on commit 0c2ea3c

Please sign in to comment.