27
27
import io .reactivex .internal .functions .Objects ;
28
28
import io .reactivex .internal .fuseable .ScalarCallable ;
29
29
import io .reactivex .internal .operators .flowable .*;
30
+ import io .reactivex .internal .operators .flowable .FlowableConcatMap .ErrorMode ;
30
31
import io .reactivex .internal .subscribers .flowable .*;
31
32
import io .reactivex .internal .subscriptions .EmptySubscription ;
32
33
import io .reactivex .plugins .RxJavaPlugins ;
@@ -1467,7 +1468,7 @@ public final <R> Flowable<R> concatMap(Function<? super T, ? extends Publisher<?
1467
1468
if (prefetch <= 0 ) {
1468
1469
throw new IllegalArgumentException ("prefetch > 0 required but it was " + prefetch );
1469
1470
}
1470
- return new FlowableConcatMap <T , R >(this , mapper , prefetch );
1471
+ return new FlowableConcatMap <T , R >(this , mapper , prefetch , ErrorMode . IMMEDIATE );
1471
1472
}
1472
1473
1473
1474
@ BackpressureSupport (BackpressureKind .FULL )
@@ -1480,12 +1481,7 @@ public final <U> Flowable<U> concatMapIterable(Function<? super T, ? extends Ite
1480
1481
@ SchedulerSupport (SchedulerSupport .NONE )
1481
1482
public final <U > Flowable <U > concatMapIterable (final Function <? super T , ? extends Iterable <? extends U >> mapper , int prefetch ) {
1482
1483
Objects .requireNonNull (mapper , "mapper is null" );
1483
- return concatMap (new Function <T , Publisher <U >>() {
1484
- @ Override
1485
- public Publisher <U > apply (T v ) {
1486
- return new FlowableFromIterable <U >(mapper .apply (v ));
1487
- }
1488
- }, prefetch );
1484
+ return new FlowableFlattenIterable <T , U >(this , mapper , prefetch );
1489
1485
}
1490
1486
1491
1487
@ BackpressureSupport (BackpressureKind .FULL )
@@ -2029,13 +2025,7 @@ public final <U, R> Flowable<R> flatMap(Function<? super T, ? extends Publisher<
2029
2025
@ BackpressureSupport (BackpressureKind .FULL )
2030
2026
@ SchedulerSupport (SchedulerSupport .NONE )
2031
2027
public final <U > Flowable <U > flatMapIterable (final Function <? super T , ? extends Iterable <? extends U >> mapper ) {
2032
- Objects .requireNonNull (mapper , "mapper is null" );
2033
- return flatMap (new Function <T , Publisher <U >>() {
2034
- @ Override
2035
- public Publisher <U > apply (T v ) {
2036
- return new FlowableFromIterable <U >(mapper .apply (v ));
2037
- }
2038
- });
2028
+ return flatMapIterable (mapper , bufferSize ());
2039
2029
}
2040
2030
2041
2031
@ BackpressureSupport (BackpressureKind .FULL )
@@ -2054,12 +2044,7 @@ public Publisher<U> apply(T t) {
2054
2044
@ BackpressureSupport (BackpressureKind .FULL )
2055
2045
@ SchedulerSupport (SchedulerSupport .NONE )
2056
2046
public final <U > Flowable <U > flatMapIterable (final Function <? super T , ? extends Iterable <? extends U >> mapper , int bufferSize ) {
2057
- return flatMap (new Function <T , Publisher <U >>() {
2058
- @ Override
2059
- public Publisher <U > apply (T v ) {
2060
- return new FlowableFromIterable <U >(mapper .apply (v ));
2061
- }
2062
- }, false , bufferSize );
2047
+ return new FlowableFlattenIterable <T , U >(this , mapper , bufferSize );
2063
2048
}
2064
2049
2065
2050
@ BackpressureSupport (BackpressureKind .NONE )
0 commit comments