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

82 lines
2.2 KiB
Java
Raw Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.ArrayDeque;
/* renamed from: o.fXs, reason: case insensitive filesystem */
/* loaded from: classes6.dex */
public final class C13345fXs<T> extends fUX<T, T> {
private int d;
public C13345fXs(InterfaceC13169fSq<T> interfaceC13169fSq, int i) {
super(interfaceC13169fSq);
this.d = i;
}
@Override // o.AbstractC13163fSk
public final void subscribeActual(InterfaceC13174fSv<? super T> interfaceC13174fSv) {
this.c.subscribe(new LWm(interfaceC13174fSv, this.d));
}
/* renamed from: o.fXs$LWm */
/* loaded from: classes6.dex */
static final class LWm<T> extends ArrayDeque<T> implements InterfaceC13174fSv<T>, fSJ {
private fSJ a;
private int c;
private volatile boolean d;
private InterfaceC13174fSv<? super T> e;
LWm(InterfaceC13174fSv<? super T> interfaceC13174fSv, int i) {
this.e = interfaceC13174fSv;
this.c = i;
}
@Override // o.InterfaceC13174fSv
public final void onSubscribe(fSJ fsj) {
if (EnumC13192fTf.d(this.a, fsj)) {
this.a = fsj;
this.e.onSubscribe(this);
}
}
@Override // o.InterfaceC13174fSv
public final void onNext(T t) {
if (this.c == size()) {
poll();
}
offer(t);
}
@Override // o.InterfaceC13174fSv
public final void onError(Throwable th) {
this.e.onError(th);
}
@Override // o.InterfaceC13174fSv
public final void onComplete() {
InterfaceC13174fSv<? super T> interfaceC13174fSv = this.e;
while (!this.d) {
T poll = poll();
if (poll == null) {
interfaceC13174fSv.onComplete();
return;
}
interfaceC13174fSv.onNext(poll);
}
}
@Override // o.fSJ
public final void dispose() {
if (this.d) {
return;
}
this.d = true;
this.a.dispose();
}
@Override // o.fSJ
public final boolean isDisposed() {
return this.d;
}
}
}