package o;

import java.util.Iterator;

/* compiled from: r8-map-id-3b7cc9102578c509342fa2f0fabed2bfc72239cd258d579fc679bfcbc198b048 */
/* loaded from: classes.dex */
public final class S30 extends T30 implements Iterator {
    public R30 l;
    public boolean m = true;
    public final /* synthetic */ U30 n;

    public S30(U30 u30) {
        this.n = u30;
    }

    @Override // o.T30
    public final void a(R30 r30) {
        R30 r302 = this.l;
        if (r30 == r302) {
            R30 r303 = r302.f307o;
            this.l = r303;
            this.m = r303 == null;
        }
    }

    @Override // java.util.Iterator
    public final boolean hasNext() {
        if (this.m) {
            return this.n.l != null;
        }
        R30 r30 = this.l;
        return (r30 == null || r30.n == null) ? false : true;
    }

    @Override // java.util.Iterator
    public final Object next() {
        if (this.m) {
            this.m = false;
            this.l = this.n.l;
        } else {
            R30 r30 = this.l;
            this.l = r30 != null ? r30.n : null;
        }
        return this.l;
    }
}
