package defpackage;

import java.util.ConcurrentModificationException;
import java.util.Iterator;
import java.util.NoSuchElementException;

/* JADX INFO: loaded from: classes2.dex */
class i71 implements Iterator<Object> {
    public int a;
    public int b;
    public int c = -1;
    public final /* synthetic */ j71 d;

    public i71(j71 j71Var) {
        this.d = j71Var;
        this.a = j71Var.d;
        this.b = j71Var.e();
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        return this.b >= 0;
    }

    @Override // java.util.Iterator
    public final Object next() {
        j71 j71Var = this.d;
        if (j71Var.d != this.a) {
            throw new ConcurrentModificationException();
        }
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        int i = this.b;
        this.c = i;
        Object obj = j71Var.k()[i];
        this.b = j71Var.f(this.b);
        return obj;
    }

    @Override // java.util.Iterator
    public final void remove() {
        j71 j71Var = this.d;
        if (j71Var.d != this.a) {
            throw new ConcurrentModificationException();
        }
        k41.d(this.c >= 0);
        this.a += 32;
        j71Var.remove(j71Var.k()[this.c]);
        this.b = j71Var.a(this.b, this.c);
        this.c = -1;
    }
}
