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

86 lines
2.4 KiB
Java

package o;
/* loaded from: classes6.dex */
public final class fVI<T, K> extends fUX<T, T> {
private fSS<? super T, K> d;
private fSN<? super K, ? super K> e;
public fVI(InterfaceC13169fSq<T> interfaceC13169fSq, fSS<? super T, K> fss, fSN<? super K, ? super K> fsn) {
super(interfaceC13169fSq);
this.d = fss;
this.e = fsn;
}
@Override // o.AbstractC13163fSk
public final void subscribeActual(InterfaceC13174fSv<? super T> interfaceC13174fSv) {
this.c.subscribe(new Sts(interfaceC13174fSv, this.d, this.e));
}
/* loaded from: classes6.dex */
static final class Sts<T, K> extends fTA<T, T> {
private fSN<? super K, ? super K> a;
private boolean g;
private fSS<? super T, K> i;
private K j;
Sts(InterfaceC13174fSv<? super T> interfaceC13174fSv, fSS<? super T, K> fss, fSN<? super K, ? super K> fsn) {
super(interfaceC13174fSv);
this.i = fss;
this.a = fsn;
}
@Override // o.InterfaceC13174fSv
public final void onNext(T t) {
if (this.c) {
return;
}
if (this.b != 0) {
this.d.onNext(t);
return;
}
try {
K a = this.i.a(t);
if (this.g) {
boolean d = this.a.d(this.j, a);
this.j = a;
if (d) {
return;
}
} else {
this.g = true;
this.j = a;
}
this.d.onNext(t);
} catch (Throwable th) {
b(th);
}
}
@Override // o.InterfaceC13413fZp
public final int b(int i) {
return e(i);
}
@Override // o.InterfaceC13414fZq
public final T b() throws Throwable {
T b;
boolean d;
do {
b = this.e.b();
if (b == null) {
return null;
}
K a = this.i.a(b);
if (!this.g) {
this.g = true;
this.j = a;
return b;
}
d = this.a.d(this.j, a);
this.j = a;
} while (d);
return b;
}
}
}