package 㴹.K.Ԕ.ඓ.ῲ;

import 㴹.K.AbstractC2500;
import 㴹.K.AbstractC2520;
import 㴹.K.Ԕ.ῲ.C2456;
import 㴹.K.Ԕ.㸾.AbstractC2488;

/* renamed from: 㴹.K.Ԕ.ඓ.ῲ.ʬ  reason: contains not printable characters */
/* compiled from: ObservableFromArray */
public final class C2440<T> extends AbstractC2500<T> {

    /* renamed from: ῲ  reason: contains not printable characters */
    public final T[] f8378;

    /* renamed from: 㴹.K.Ԕ.ඓ.ῲ.ʬ$K  reason: contains not printable characters */
    /* compiled from: ObservableFromArray */
    public static final class C2441<T> extends AbstractC2488<T> {

        /* renamed from: ʬ  reason: contains not printable characters */
        public final T[] f8379;

        /* renamed from: ඓ  reason: contains not printable characters */
        public boolean f8380;

        /* renamed from: ῲ  reason: contains not printable characters */
        public final AbstractC2520<? super T> f8381;

        /* renamed from: 㴹  reason: contains not printable characters */
        public volatile boolean f8382;

        /* renamed from: 㸾  reason: contains not printable characters */
        public int f8383;

        public C2441(AbstractC2520<? super T> r1, T[] tArr) {
            this.f8381 = r1;
            this.f8379 = tArr;
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2439
        public void clear() {
            this.f8383 = this.f8379.length;
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public void dispose() {
            this.f8382 = true;
        }

        @Override // 㴹.K.㑃.AbstractC2514
        public boolean isDisposed() {
            return this.f8382;
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2439
        public boolean isEmpty() {
            return this.f8383 == this.f8379.length;
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2439
        public T poll() {
            int i = this.f8383;
            T[] tArr = this.f8379;
            if (i == tArr.length) {
                return null;
            }
            this.f8383 = i + 1;
            T t = tArr[i];
            C2456.m6500(t, "The array element is null");
            return t;
        }

        @Override // 㴹.K.Ԕ.ʬ.AbstractC2438
        public int requestFusion(int i) {
            if ((i & 1) == 0) {
                return 0;
            }
            this.f8380 = true;
            return 1;
        }
    }

    public C2440(T[] tArr) {
        this.f8378 = tArr;
    }

    @Override // 㴹.K.AbstractC2500
    /* renamed from: ῲ  reason: contains not printable characters */
    public void m6486(AbstractC2520<? super T> r6) {
        C2441 k = new C2441(r6, this.f8378);
        r6.onSubscribe(k);
        if (!k.f8380) {
            T[] tArr = k.f8379;
            int length = tArr.length;
            for (int i = 0; i < length && !k.f8382; i++) {
                T t = tArr[i];
                if (t == null) {
                    AbstractC2520<? super T> r62 = k.f8381;
                    r62.onError(new NullPointerException("The " + i + "th element is null"));
                    return;
                }
                k.f8381.onNext(t);
            }
            if (!k.f8382) {
                k.f8381.onComplete();
            }
        }
    }
}
