package j.r0;

import j.k0.e0;
import java.util.NoSuchElementException;

/* JADX INFO: compiled from: ProgressionIterators.kt */
/* JADX INFO: loaded from: classes.dex */
public final class g extends e0 {
    private final int b;
    private final int d;
    private boolean e;
    private int f;

    public g(int i2, int i3, int i4) {
        this.b = i4;
        this.d = i3;
        boolean z = true;
        if (i4 <= 0 ? i2 < i3 : i2 > i3) {
            z = false;
        }
        this.e = z;
        this.f = z ? i2 : this.d;
    }

    @Override // j.k0.e0
    public int b() {
        int i2 = this.f;
        if (i2 != this.d) {
            this.f = this.b + i2;
        } else {
            if (!this.e) {
                throw new NoSuchElementException();
            }
            this.e = false;
        }
        return i2;
    }

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