Skip to content

Commit ab02902

Browse files
author
Kevin Coughlin
committed
Use ternary for comparison in place of Long.compareTo for Java 6 support.
1 parent 27bb157 commit ab02902

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/rx/schedulers/TestScheduler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,9 @@ private static class CompareActionsByTime implements Comparator<TimedAction> {
5757
@Override
5858
public int compare(TimedAction action1, TimedAction action2) {
5959
if (action1.time == action2.time) {
60-
return Long.valueOf(action1.count).compareTo(action2.count);
60+
return action1.count < action2.count ? -1 : ((action1.count > action2.count) ? 1 : 0);
6161
} else {
62-
return Long.valueOf(action1.time).compareTo(action2.time);
62+
return action1.time < action2.time ? -1 : ((action1.time > action2.time) ? 1 : 0);
6363
}
6464
}
6565
}

0 commit comments

Comments
 (0)