104 lines
3.1 KiB
Java
104 lines
3.1 KiB
Java
|
package o;
|
||
|
|
||
|
import java.util.Objects;
|
||
|
import java.util.function.BiConsumer;
|
||
|
import java.util.function.Function;
|
||
|
import java.util.stream.Collector;
|
||
|
|
||
|
/* renamed from: o.fTo, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes6.dex */
|
||
|
public final class C13201fTo<T, A, R> extends AbstractC13163fSk<R> {
|
||
|
private AbstractC13163fSk<T> a;
|
||
|
private Collector<? super T, A, R> e;
|
||
|
|
||
|
public C13201fTo(AbstractC13163fSk<T> abstractC13163fSk, Collector<? super T, A, R> collector) {
|
||
|
this.a = abstractC13163fSk;
|
||
|
this.e = collector;
|
||
|
}
|
||
|
|
||
|
@Override // o.AbstractC13163fSk
|
||
|
public final void subscribeActual(InterfaceC13174fSv<? super R> interfaceC13174fSv) {
|
||
|
try {
|
||
|
this.a.subscribe(new RVV(interfaceC13174fSv, this.e.supplier().get(), this.e.accumulator(), this.e.finisher()));
|
||
|
} catch (Throwable th) {
|
||
|
C13147fSI.c(th);
|
||
|
EnumC13195fTi.a(th, interfaceC13174fSv);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* renamed from: o.fTo$RVV */
|
||
|
/* loaded from: classes6.dex */
|
||
|
static final class RVV<T, A, R> extends fTO<R> implements InterfaceC13174fSv<T> {
|
||
|
private Function<A, R> a;
|
||
|
private A b;
|
||
|
private BiConsumer<A, T> d;
|
||
|
private boolean e;
|
||
|
private fSJ i;
|
||
|
|
||
|
RVV(InterfaceC13174fSv<? super R> interfaceC13174fSv, A a, BiConsumer<A, T> biConsumer, Function<A, R> function) {
|
||
|
super(interfaceC13174fSv);
|
||
|
this.b = a;
|
||
|
this.d = biConsumer;
|
||
|
this.a = function;
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onSubscribe(fSJ fsj) {
|
||
|
if (EnumC13192fTf.d(this.i, fsj)) {
|
||
|
this.i = fsj;
|
||
|
this.c.onSubscribe(this);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onNext(T t) {
|
||
|
if (this.e) {
|
||
|
return;
|
||
|
}
|
||
|
try {
|
||
|
this.d.accept(this.b, t);
|
||
|
} catch (Throwable th) {
|
||
|
C13147fSI.c(th);
|
||
|
this.i.dispose();
|
||
|
onError(th);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onError(Throwable th) {
|
||
|
if (this.e) {
|
||
|
C13418fZu.c(th);
|
||
|
return;
|
||
|
}
|
||
|
this.e = true;
|
||
|
this.i = EnumC13192fTf.DISPOSED;
|
||
|
this.b = null;
|
||
|
this.c.onError(th);
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
@Override // o.InterfaceC13174fSv
|
||
|
public final void onComplete() {
|
||
|
if (this.e) {
|
||
|
return;
|
||
|
}
|
||
|
this.e = true;
|
||
|
this.i = EnumC13192fTf.DISPOSED;
|
||
|
A a = this.b;
|
||
|
this.b = null;
|
||
|
try {
|
||
|
d(Objects.requireNonNull(this.a.apply(a), "The finisher returned a null value"));
|
||
|
} catch (Throwable th) {
|
||
|
C13147fSI.c(th);
|
||
|
this.c.onError(th);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // o.fTO, o.fSJ
|
||
|
public final void dispose() {
|
||
|
super.dispose();
|
||
|
this.i.dispose();
|
||
|
}
|
||
|
}
|
||
|
}
|