package n;

import java.util.Iterator;

/* JADX INFO: loaded from: classes.dex */
public final class d extends f implements Iterator {

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

    /* JADX INFO: renamed from: b, reason: collision with root package name */
    public boolean f30709b = true;

    /* JADX INFO: renamed from: c, reason: collision with root package name */
    public final /* synthetic */ g f30710c;

    public d(g gVar) {
        this.f30710c = gVar;
    }

    @Override // n.f
    public final void a(c cVar) {
        c cVar2 = this.f30708a;
        if (cVar == cVar2) {
            c cVar3 = cVar2.f30707d;
            this.f30708a = cVar3;
            this.f30709b = cVar3 == null;
        }
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        if (this.f30709b) {
            return this.f30710c.f30713a != null;
        }
        c cVar = this.f30708a;
        return (cVar == null || cVar.f30706c == null) ? false : true;
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (this.f30709b) {
            this.f30709b = false;
            this.f30708a = this.f30710c.f30713a;
        } else {
            c cVar = this.f30708a;
            this.f30708a = cVar != null ? cVar.f30706c : null;
        }
        return this.f30708a;
    }
}
