Merge "Use common Comparator."
This commit is contained in:
@@ -64,8 +64,11 @@ public abstract class AlarmQueue<K> implements AlarmManager.OnAlarmListener {
|
||||
* The pair is the key and its associated alarm time (in the elapsed realtime timebase).
|
||||
*/
|
||||
private static class AlarmPriorityQueue<Q> extends PriorityQueue<Pair<Q, Long>> {
|
||||
private static final Comparator<Pair<?, Long>> sTimeComparator =
|
||||
(o1, o2) -> Long.compare(o1.second, o2.second);
|
||||
|
||||
AlarmPriorityQueue() {
|
||||
super(1, Comparator.comparingLong(o -> o.second));
|
||||
super(1, sTimeComparator);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user