Skip to content

Commit 24ed859

Browse files
authored
Code clean up
1 parent 3b04433 commit 24ed859

File tree

1 file changed

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

1 file changed

+4
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1346,8 +1346,10 @@ object JsonCodecMaker {
13461346
val m = 1 << i
13471347
val nm = ~m
13481348
(fieldInfo.mappedName, {
1349-
if (cfg.checkFieldDuplication) q"if (($n & $m) != 0) $n ^= $m else in.duplicatedKeyError(l)"
1350-
else if (required(fieldInfo.mappedName)) q"$n &= $nm"
1349+
if (cfg.checkFieldDuplication) {
1350+
q"""if (($n & $m) == 0) in.duplicatedKeyError(l)
1351+
$n ^= $m"""
1352+
} else if (required(fieldInfo.mappedName)) q"$n &= $nm"
13511353
else EmptyTree
13521354
})
13531355
}.toMap

0 commit comments

Comments
 (0)