Skip to content

Commit

Permalink
rewrite to use val instead of def
Browse files Browse the repository at this point in the history
  • Loading branch information
lewisjkl committed Apr 12, 2024
1 parent 8dfa8ff commit e176382
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,14 @@ private[compiler] object EmptyStructureToUnitTransformer
d match {
case s: Structure =>
(s.localFields.isEmpty && s.parents.isEmpty && s.hints.isEmpty) || {
def isHttpPayload =
val isHttpPayload =
s.localFields.length == 1 && s.localFields.head.hints
.contains(Hint.Body)
def isHttpPayloadEmpty = defs
.get(s.localFields.head.tpe)
val isHttpPayloadEmpty = s.localFields.headOption
.flatMap(f =>
defs
.get(f.tpe)
)
.exists(isEmptyStructure(defs, _))
isHttpPayload && isHttpPayloadEmpty
}
Expand Down

0 comments on commit e176382

Please sign in to comment.