discord-jadx/app/src/main/java/j0/l/a/h2.java

63 lines
1.6 KiB
Java

package j0.l.a;
import j0.k.b;
import rx.Observable;
import rx.Subscriber;
/* compiled from: OperatorTakeUntilPredicate */
public final class h2<T> implements Observable.b<T, T> {
public final b<? super T, Boolean> i;
/* compiled from: OperatorTakeUntilPredicate */
public final class a extends Subscriber<T> {
public final Subscriber<? super T> i;
public boolean j;
public a(Subscriber<? super T> subscriber) {
this.i = subscriber;
}
@Override // j0.g
public void onCompleted() {
if (!this.j) {
this.i.onCompleted();
}
}
@Override // j0.g
public void onError(Throwable th) {
if (!this.j) {
this.i.onError(th);
}
}
@Override // j0.g
public void onNext(T t) {
this.i.onNext(t);
try {
if (h2.this.i.call(t).booleanValue()) {
this.j = true;
this.i.onCompleted();
unsubscribe();
}
} catch (Throwable th) {
this.j = true;
c.q.a.k.a.b0(th, this.i, t);
unsubscribe();
}
}
}
public h2(b<? super T, Boolean> bVar) {
this.i = bVar;
}
@Override // j0.k.b
public Object call(Object obj) {
Subscriber subscriber = (Subscriber) obj;
a aVar = new a(subscriber);
subscriber.add(aVar);
subscriber.setProducer(new g2(this, aVar));
return aVar;
}
}