We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
OpenRTBWriting.circe
OpenRTBWriting.circeJsoniter
1 parent 49df44d commit be83662Copy full SHA for be83662
jsoniter-scala-benchmark/shared/src/main/scala/io/circe/Util.scala
@@ -40,6 +40,11 @@ object Util {
40
41
def deepDropEmptyValues(json: Json): Json = json.foldWith(dropEmptyValueFolder)
42
43
- def toJObject(fields: (String, Json)*): Json =
44
- Json.obj(fields.filterNot { case (_, v) => v.isNull || (v.isArray && v.asInstanceOf[JArray].value.isEmpty) }: _*)
+ def toJObject(fields: (String, Json)*): Json = new JObject(JsonObject.fromLinkedHashMap {
+ val map = new util.LinkedHashMap[String, Json]
45
+ fields.foreach { case (k, v) =>
46
+ if (!(v.isNull || v.isArray && v.asInstanceOf[JArray].value.isEmpty)) map.put(k, v)
47
+ }
48
+ map
49
+ })
50
}
0 commit comments