Skip to content

Commit ed4c081

Browse files
slisaasquatchakarnokd
authored andcommitted
Deleted Functions.naturalOrder (#6817)
1 parent 9e2fa63 commit ed4c081

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

src/main/java/io/reactivex/rxjava3/core/Observable.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14692,7 +14692,7 @@ public final Flowable<T> toFlowable(@NonNull BackpressureStrategy strategy) {
1469214692
@SchedulerSupport(SchedulerSupport.NONE)
1469314693
@NonNull
1469414694
public final Single<@NonNull List<T>> toSortedList() {
14695-
return toSortedList(Functions.naturalOrder());
14695+
return toSortedList(Functions.naturalComparator());
1469614696
}
1469714697

1469814698
/**
@@ -14786,7 +14786,7 @@ public final Flowable<T> toFlowable(@NonNull BackpressureStrategy strategy) {
1478614786
@SchedulerSupport(SchedulerSupport.NONE)
1478714787
@NonNull
1478814788
public final Single<@NonNull List<T>> toSortedList(int capacityHint) {
14789-
return toSortedList(Functions.naturalOrder(), capacityHint);
14789+
return toSortedList(Functions.naturalComparator(), capacityHint);
1479014790
}
1479114791

1479214792
/**

src/main/java/io/reactivex/rxjava3/internal/functions/Functions.java

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,6 @@ public static <T> Consumer<T> emptyConsumer() {
124124

125125
static final Supplier<Object> NULL_SUPPLIER = new NullProvider();
126126

127-
static final Comparator<Object> NATURAL_COMPARATOR = new NaturalObjectComparator();
128-
129127
@SuppressWarnings("unchecked")
130128
@NonNull
131129
public static <T> Predicate<T> alwaysTrue() {
@@ -144,17 +142,6 @@ public static <T> Supplier<T> nullSupplier() {
144142
return (Supplier<T>)NULL_SUPPLIER;
145143
}
146144

147-
/**
148-
* Returns a natural order comparator which casts the parameters to Comparable.
149-
* @param <T> the value type
150-
* @return a natural order comparator which casts the parameters to Comparable
151-
*/
152-
@SuppressWarnings("unchecked")
153-
@NonNull
154-
public static <T> Comparator<T> naturalOrder() {
155-
return (Comparator<T>)NATURAL_COMPARATOR;
156-
}
157-
158145
static final class FutureAction implements Action {
159146
final Future<?> future;
160147

@@ -767,14 +754,6 @@ public Object get() {
767754
}
768755
}
769756

770-
static final class NaturalObjectComparator implements Comparator<Object> {
771-
@SuppressWarnings({ "unchecked", "rawtypes" })
772-
@Override
773-
public int compare(Object a, Object b) {
774-
return ((Comparable)a).compareTo(b);
775-
}
776-
}
777-
778757
static final class MaxRequestSubscription implements Consumer<Subscription> {
779758
@Override
780759
public void accept(Subscription t) {

0 commit comments

Comments
 (0)