Skip to content

Commit

Permalink
Avoid special-casing empty condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-bucev authored and vkuncak committed Apr 28, 2022
1 parent 9dc1746 commit a041c97
Showing 1 changed file with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -402,15 +402,8 @@ class AntiAliasing(override val s: Trees)(override val t: s.type)(using override
def groupedTargets(targets: Set[Target]): Set[Target] = {
targets.groupBy(t => (t.receiver, t.path))
.map { case ((recv, path), tgs) =>
val conds = tgs.flatMap(_.condition)
val combinedCond = {
if (conds.isEmpty) None
else {
val cond0 = simplifyOr(conds.toSeq)
if (cond0 == BooleanLiteral(true)) None else Some(cond0)
}
}
Target(recv, combinedCond, path)
val cond = simplifyOr(tgs.map(_.condition.getOrElse(BooleanLiteral(true))).toSeq)
Target(recv, if (cond == BooleanLiteral(true)) None else Some(cond), path)
}.toSet
}

Expand Down

0 comments on commit a041c97

Please sign in to comment.