Skip to content

Commit f7334d3

Browse files
committed
Use Ordering.fromInt() instead of a ternary operator in
Ord.comparableOrd().
1 parent 05ec1cd commit f7334d3

1 file changed

Lines changed: 1 addition & 2 deletions

File tree

core/src/main/java/fj/Ord.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,8 +630,7 @@ public static <A extends Comparable<A>> Ord<A> comparableOrd() {
630630
public F<A, Ordering> f(final A a1) {
631631
return new F<A, Ordering>() {
632632
public Ordering f(final A a2) {
633-
final int x = a1.compareTo(a2);
634-
return x < 0 ? Ordering.LT : x == 0 ? Ordering.EQ : Ordering.GT;
633+
return Ordering.fromInt(a1.compareTo(a2));
635634
}
636635
};
637636
}

0 commit comments

Comments
 (0)