Skip to content

Commit 7a9cb21

Browse files
authored
Merge pull request #2809 from sshark/remove-if-else
Remove if-else syntax for readability
2 parents b75cd30 + 86d1109 commit 7a9cb21

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)