Skip to content

Commit 0ea2c95

Browse files
authoredMar 4, 2018
2.x: Improve coverage and fix small mistakes/untaken paths in operators (#5883)
1 parent f6f6d82 commit 0ea2c95

File tree

46 files changed

+2713
-178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2713
-178
lines changed
 

‎src/main/java/io/reactivex/Maybe.java

+5-4
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ public static <T> Flowable<T> merge(Publisher<? extends MaybeSource<? extends T>
888888
public static <T> Flowable<T> merge(Publisher<? extends MaybeSource<? extends T>> sources, int maxConcurrency) {
889889
ObjectHelper.requireNonNull(sources, "source is null");
890890
ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
891-
return RxJavaPlugins.onAssembly(new FlowableFlatMapPublisher(sources, MaybeToPublisher.instance(), false, maxConcurrency, Flowable.bufferSize()));
891+
return RxJavaPlugins.onAssembly(new FlowableFlatMapPublisher(sources, MaybeToPublisher.instance(), false, maxConcurrency, 1));
892892
}
893893

894894
/**
@@ -1222,12 +1222,11 @@ public static <T> Flowable<T> mergeDelayError(Iterable<? extends MaybeSource<? e
12221222
* {@code source} Publisher
12231223
* @see <a href="http://reactivex.io/documentation/operators/merge.html">ReactiveX operators documentation: Merge</a>
12241224
*/
1225-
@SuppressWarnings({ "unchecked", "rawtypes" })
12261225
@BackpressureSupport(BackpressureKind.FULL)
12271226
@CheckReturnValue
12281227
@SchedulerSupport(SchedulerSupport.NONE)
12291228
public static <T> Flowable<T> mergeDelayError(Publisher<? extends MaybeSource<? extends T>> sources) {
1230-
return Flowable.fromPublisher(sources).flatMap((Function)MaybeToPublisher.instance(), true);
1229+
return mergeDelayError(sources, Integer.MAX_VALUE);
12311230
}
12321231

12331232

@@ -1267,7 +1266,9 @@ public static <T> Flowable<T> mergeDelayError(Publisher<? extends MaybeSource<?
12671266
@SchedulerSupport(SchedulerSupport.NONE)
12681267
@Experimental
12691268
public static <T> Flowable<T> mergeDelayError(Publisher<? extends MaybeSource<? extends T>> sources, int maxConcurrency) {
1270-
return Flowable.fromPublisher(sources).flatMap((Function)MaybeToPublisher.instance(), true, maxConcurrency);
1269+
ObjectHelper.requireNonNull(sources, "source is null");
1270+
ObjectHelper.verifyPositive(maxConcurrency, "maxConcurrency");
1271+
return RxJavaPlugins.onAssembly(new FlowableFlatMapPublisher(sources, MaybeToPublisher.instance(), true, maxConcurrency, 1));
12711272
}
12721273

12731274
/**

‎src/main/java/io/reactivex/internal/operators/flowable/FlowableFlatMap.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ boolean addInner(InnerSubscriber<T, U> inner) {
185185
void removeInner(InnerSubscriber<T, U> inner) {
186186
for (;;) {
187187
InnerSubscriber<?, ?>[] a = subscribers.get();
188-
if (a == CANCELLED || a == EMPTY) {
188+
int n = a.length;
189+
if (n == 0) {
189190
return;
190191
}
191-
int n = a.length;
192192
int j = -1;
193193
for (int i = 0; i < n; i++) {
194194
if (a[i] == inner) {

0 commit comments

Comments
 (0)
Please sign in to comment.