package defpackage;

import defpackage.g0;
import java.util.Collection;
import java.util.Iterator;
import java.util.Map;

/* JADX INFO: loaded from: classes2.dex */
class h0 implements Iterator<Object> {
    public Map.Entry a;
    public final /* synthetic */ Iterator b;
    public final /* synthetic */ g0.c c;

    public h0(g0.c cVar, Iterator it) {
        this.b = it;
        this.c = cVar;
    }

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

    @Override // java.util.Iterator
    public final Object next() {
        Map.Entry entry = (Map.Entry) this.b.next();
        this.a = entry;
        return entry.getKey();
    }

    @Override // java.util.Iterator
    public final void remove() {
        if7.p(this.a != null, "no calls to next() since the last call to remove()");
        Collection collection = (Collection) this.a.getValue();
        this.b.remove();
        g0.this.f -= collection.size();
        collection.clear();
        this.a = null;
    }
}
