Skip to content

Commit 9e6f21d

Browse files
committed
Make compare() method more concise
1 parent 5f8d03c commit 9e6f21d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

source/list.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ export class List {
7474
*/
7575
compare(ys) {
7676
if (isEmpty(this) && isEmpty(ys)) { return EQ; }
77-
if (isEmpty(this) && isEmpty(ys) === false) { return LT; }
78-
if (isEmpty(this) === false && isEmpty(ys)) { return GT; }
77+
if (isEmpty(this) && !isEmpty(ys)) { return LT; }
78+
if (!isEmpty(this) && isEmpty(ys)) { return GT; }
7979
if (this.head() === head(ys)) { return this.tail().compare(tail(ys)); }
8080
return this.head() < head(ys) ? LT : GT;
8181
}

0 commit comments

Comments
 (0)