package ld;

import kotlin.collections.builders.MapBuilder;

/* JADX INFO: loaded from: classes.dex */
public abstract class d {

    /* JADX INFO: renamed from: a, reason: collision with root package name */
    public final MapBuilder f30218a;

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public int f30219b;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public int f30220c;

    public d(MapBuilder mapBuilder) {
        nb.g.i(mapBuilder, "map");
        this.f30218a = mapBuilder;
        this.f30220c = -1;
        a();
    }

    public final void a() {
        while (true) {
            int i10 = this.f30219b;
            MapBuilder mapBuilder = this.f30218a;
            if (i10 >= mapBuilder.length) {
                return;
            }
            int[] iArr = mapBuilder.presenceArray;
            int i11 = this.f30219b;
            if (iArr[i11] >= 0) {
                return;
            } else {
                this.f30219b = i11 + 1;
            }
        }
    }

    public final boolean hasNext() {
        return this.f30219b < this.f30218a.length;
    }

    public final void remove() {
        if (this.f30220c == -1) {
            throw new IllegalStateException("Call next() before removing element from the iterator.".toString());
        }
        MapBuilder mapBuilder = this.f30218a;
        mapBuilder.k();
        mapBuilder.u(this.f30220c);
        this.f30220c = -1;
    }
}
