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

103 lines
3.1 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.Collection;
import java.util.Objects;
/* loaded from: classes6.dex */
public final class fVH<T, K> extends fUX<T, T> {
private fSS<? super T, K> b;
private InterfaceC13189fTc<? extends Collection<? super K>> e;
public fVH(InterfaceC13169fSq<T> interfaceC13169fSq, fSS<? super T, K> fss, InterfaceC13189fTc<? extends Collection<? super K>> interfaceC13189fTc) {
super(interfaceC13169fSq);
this.b = fss;
this.e = interfaceC13189fTc;
}
@Override // o.AbstractC13163fSk
public final void subscribeActual(InterfaceC13174fSv<? super T> interfaceC13174fSv) {
try {
this.c.subscribe(new Sts(interfaceC13174fSv, this.b, (Collection) fYR.d(this.e.d(), "The collectionSupplier returned a null Collection.")));
} catch (Throwable th) {
C13147fSI.c(th);
EnumC13195fTi.a(th, interfaceC13174fSv);
}
}
/* loaded from: classes6.dex */
static final class Sts<T, K> extends fTA<T, T> {
private Collection<? super K> a;
private fSS<? super T, K> i;
Sts(InterfaceC13174fSv<? super T> interfaceC13174fSv, fSS<? super T, K> fss, Collection<? super K> collection) {
super(interfaceC13174fSv);
this.i = fss;
this.a = collection;
}
@Override // o.InterfaceC13174fSv
public final void onNext(T t) {
if (this.c) {
return;
}
if (this.b == 0) {
try {
if (this.a.add(Objects.requireNonNull(this.i.a(t), "The keySelector returned a null key"))) {
this.d.onNext(t);
return;
}
return;
} catch (Throwable th) {
b(th);
return;
}
}
this.d.onNext(null);
}
@Override // o.fTA, o.InterfaceC13174fSv
public final void onError(Throwable th) {
if (this.c) {
C13418fZu.c(th);
return;
}
this.c = true;
this.a.clear();
this.d.onError(th);
}
@Override // o.fTA, o.InterfaceC13174fSv
public final void onComplete() {
if (this.c) {
return;
}
this.c = true;
this.a.clear();
this.d.onComplete();
}
@Override // o.InterfaceC13413fZp
public final int b(int i) {
return e(i);
}
@Override // o.InterfaceC13414fZq
public final T b() throws Throwable {
T b;
do {
b = this.e.b();
if (b == null) {
break;
}
} while (!this.a.add((Object) Objects.requireNonNull(this.i.a(b), "The keySelector returned a null key")));
return b;
}
@Override // o.fTA, o.InterfaceC13414fZq
public final void e() {
this.a.clear();
super.e();
}
}
}