129 lines
4.0 KiB
Java
129 lines
4.0 KiB
Java
package io.reactivex.internal.util;
|
|
|
|
import io.reactivex.Observer;
|
|
import io.reactivex.disposables.Disposable;
|
|
import io.reactivex.internal.fuseable.SimpleQueue;
|
|
import io.reactivex.internal.queue.SpscArrayQueue;
|
|
import io.reactivex.internal.queue.SpscLinkedArrayQueue;
|
|
import org.reactivestreams.Subscription;
|
|
|
|
/* loaded from: classes2.dex */
|
|
public final class QueueDrainHelper {
|
|
/* JADX WARN: Code restructure failed: missing block: B:12:0x0033, code lost:
|
|
|
|
r1 = r15.a(-r1);
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:13:0x0038, code lost:
|
|
|
|
if (r1 != 0) goto L21;
|
|
*/
|
|
/* JADX WARN: Code restructure failed: missing block: B:15:0x003a, code lost:
|
|
|
|
return;
|
|
*/
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
To view partially-correct code enable 'Show inconsistent code' option in preferences
|
|
*/
|
|
public static <T, U> void a(io.reactivex.internal.fuseable.SimplePlainQueue<T> r11, io.reactivex.Observer<? super U> r12, boolean r13, io.reactivex.disposables.Disposable r14, io.reactivex.internal.util.ObservableQueueDrain<T, U> r15) {
|
|
/*
|
|
r0 = 1
|
|
r1 = 1
|
|
L2:
|
|
boolean r2 = r15.a()
|
|
boolean r3 = r11.isEmpty()
|
|
r4 = r12
|
|
r5 = r13
|
|
r6 = r11
|
|
r7 = r14
|
|
r8 = r15
|
|
boolean r2 = a(r2, r3, r4, r5, r6, r7, r8)
|
|
if (r2 == 0) goto L16
|
|
return
|
|
L16:
|
|
boolean r3 = r15.a()
|
|
java.lang.Object r2 = r11.poll()
|
|
if (r2 != 0) goto L22
|
|
r10 = 1
|
|
goto L24
|
|
L22:
|
|
r4 = 0
|
|
r10 = 0
|
|
L24:
|
|
r4 = r10
|
|
r5 = r12
|
|
r6 = r13
|
|
r7 = r11
|
|
r8 = r14
|
|
r9 = r15
|
|
boolean r3 = a(r3, r4, r5, r6, r7, r8, r9)
|
|
if (r3 == 0) goto L31
|
|
return
|
|
L31:
|
|
if (r10 == 0) goto L3b
|
|
int r1 = -r1
|
|
int r1 = r15.a(r1)
|
|
if (r1 != 0) goto L2
|
|
return
|
|
L3b:
|
|
r15.a(r12, r2)
|
|
goto L16
|
|
*/
|
|
throw new UnsupportedOperationException("Method not decompiled: io.reactivex.internal.util.QueueDrainHelper.a(io.reactivex.internal.fuseable.SimplePlainQueue, io.reactivex.Observer, boolean, io.reactivex.disposables.Disposable, io.reactivex.internal.util.ObservableQueueDrain):void");
|
|
}
|
|
|
|
public static <T, U> boolean a(boolean z, boolean z2, Observer<?> observer, boolean z3, SimpleQueue<?> simpleQueue, Disposable disposable, ObservableQueueDrain<T, U> observableQueueDrain) {
|
|
if (observableQueueDrain.b()) {
|
|
simpleQueue.clear();
|
|
disposable.dispose();
|
|
return true;
|
|
}
|
|
if (!z) {
|
|
return false;
|
|
}
|
|
if (z3) {
|
|
if (!z2) {
|
|
return false;
|
|
}
|
|
if (disposable != null) {
|
|
disposable.dispose();
|
|
}
|
|
Throwable c = observableQueueDrain.c();
|
|
if (c != null) {
|
|
observer.onError(c);
|
|
} else {
|
|
observer.onComplete();
|
|
}
|
|
return true;
|
|
}
|
|
Throwable c2 = observableQueueDrain.c();
|
|
if (c2 != null) {
|
|
simpleQueue.clear();
|
|
if (disposable != null) {
|
|
disposable.dispose();
|
|
}
|
|
observer.onError(c2);
|
|
return true;
|
|
}
|
|
if (!z2) {
|
|
return false;
|
|
}
|
|
if (disposable != null) {
|
|
disposable.dispose();
|
|
}
|
|
observer.onComplete();
|
|
return true;
|
|
}
|
|
|
|
public static <T> SimpleQueue<T> a(int i) {
|
|
if (i < 0) {
|
|
return new SpscLinkedArrayQueue(-i);
|
|
}
|
|
return new SpscArrayQueue(i);
|
|
}
|
|
|
|
public static void a(Subscription subscription, int i) {
|
|
subscription.request(i < 0 ? Long.MAX_VALUE : i);
|
|
}
|
|
}
|