Skip to content

Commit 86d1109

Browse files
committed
Remove if-else syntax for readability
1 parent b75cd30 commit 86d1109

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

_overviews/scala3-book/ca-multiversal-equality.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,14 +175,12 @@ case class AudioBook(
175175
// override to allow AudioBook to be compared to PrintedBook
176176
override def equals(that: Any): Boolean = that match
177177
case a: AudioBook =>
178-
if this.author == a.author
178+
this.author == a.author
179179
&& this.title == a.title
180180
&& this.year == a.year
181181
&& this.lengthInMinutes == a.lengthInMinutes
182-
then true else false
183182
case p: PrintedBook =>
184-
if this.author == p.author && this.title == p.title
185-
then true else false
183+
this.author == p.author && this.title == p.title
186184
case _ =>
187185
false
188186
```

0 commit comments

Comments
 (0)