what-the-bank/sources/o/fWK.java

97 lines
2.6 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.Objects;
/* loaded from: classes6.dex */
public final class fWK<T> extends AbstractC13159fSg<T> {
private InterfaceC13169fSq<T> b;
private fSL<T, T, T> d;
public fWK(InterfaceC13169fSq<T> interfaceC13169fSq, fSL<T, T, T> fsl) {
this.b = interfaceC13169fSq;
this.d = fsl;
}
@Override // o.AbstractC13159fSg
public final void a(InterfaceC13161fSi<? super T> interfaceC13161fSi) {
this.b.subscribe(new Sts(interfaceC13161fSi, this.d));
}
/* loaded from: classes6.dex */
static final class Sts<T> implements InterfaceC13174fSv<T>, fSJ {
private T a;
private fSL<T, T, T> b;
private boolean c;
private fSJ d;
private InterfaceC13161fSi<? super T> e;
Sts(InterfaceC13161fSi<? super T> interfaceC13161fSi, fSL<T, T, T> fsl) {
this.e = interfaceC13161fSi;
this.b = fsl;
}
@Override // o.InterfaceC13174fSv
public final void onSubscribe(fSJ fsj) {
if (EnumC13192fTf.d(this.d, fsj)) {
this.d = fsj;
this.e.onSubscribe(this);
}
}
@Override // o.InterfaceC13174fSv
public final void onNext(T t) {
if (this.c) {
return;
}
T t2 = this.a;
if (t2 == null) {
this.a = t;
return;
}
try {
this.a = (T) Objects.requireNonNull(this.b.e(t2, t), "The reducer returned a null value");
} catch (Throwable th) {
C13147fSI.c(th);
this.d.dispose();
onError(th);
}
}
@Override // o.InterfaceC13174fSv
public final void onError(Throwable th) {
if (this.c) {
C13418fZu.c(th);
return;
}
this.c = true;
this.a = null;
this.e.onError(th);
}
@Override // o.InterfaceC13174fSv
public final void onComplete() {
if (this.c) {
return;
}
this.c = true;
T t = this.a;
this.a = null;
if (t != null) {
this.e.e(t);
} else {
this.e.onComplete();
}
}
@Override // o.fSJ
public final void dispose() {
this.d.dispose();
}
@Override // o.fSJ
public final boolean isDisposed() {
return this.d.isDisposed();
}
}
}