2021-11-02 06:38:17 +00:00
|
|
|
package d0.f0;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
import d0.z.d.m;
|
2021-08-03 07:33:18 +00:00
|
|
|
import java.util.Iterator;
|
|
|
|
import kotlin.sequences.Sequence;
|
|
|
|
/* compiled from: Sequences.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-08-03 07:33:18 +00:00
|
|
|
public final class d<T> implements Sequence<T>, e<T> {
|
|
|
|
public final Sequence<T> a;
|
2021-12-17 21:59:34 +00:00
|
|
|
|
|
|
|
/* renamed from: b reason: collision with root package name */
|
2022-03-28 08:10:50 +00:00
|
|
|
public final int f3563b;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
|
|
|
/* compiled from: Sequences.kt */
|
2022-03-07 09:34:54 +00:00
|
|
|
/* loaded from: classes3.dex */
|
2021-11-02 06:38:17 +00:00
|
|
|
public static final class a implements Iterator<T>, d0.z.d.g0.a {
|
2021-12-02 18:53:44 +00:00
|
|
|
public final Iterator<T> j;
|
|
|
|
public int k;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
|
|
|
public a(d dVar) {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.j = d.access$getSequence$p(dVar).iterator();
|
|
|
|
this.k = d.access$getCount$p(dVar);
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final void a() {
|
2021-12-02 18:53:44 +00:00
|
|
|
while (this.k > 0 && this.j.hasNext()) {
|
|
|
|
this.j.next();
|
|
|
|
this.k--;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.util.Iterator
|
|
|
|
public boolean hasNext() {
|
|
|
|
a();
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.j.hasNext();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.util.Iterator
|
|
|
|
public T next() {
|
|
|
|
a();
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.j.next();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.util.Iterator
|
|
|
|
public void remove() {
|
|
|
|
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
|
|
public d(Sequence<? extends T> sequence, int i) {
|
|
|
|
m.checkNotNullParameter(sequence, "sequence");
|
|
|
|
this.a = sequence;
|
2022-03-28 08:10:50 +00:00
|
|
|
this.f3563b = i;
|
2021-08-03 07:33:18 +00:00
|
|
|
if (!(i >= 0)) {
|
|
|
|
throw new IllegalArgumentException(("count must be non-negative, but was " + i + '.').toString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ int access$getCount$p(d dVar) {
|
2022-03-28 08:10:50 +00:00
|
|
|
return dVar.f3563b;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Sequence access$getSequence$p(d dVar) {
|
|
|
|
return dVar.a;
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // d0.f0.e
|
2021-08-03 07:33:18 +00:00
|
|
|
public Sequence<T> drop(int i) {
|
2022-03-28 08:10:50 +00:00
|
|
|
int i2 = this.f3563b + i;
|
2021-08-03 07:33:18 +00:00
|
|
|
return i2 < 0 ? new d(this, i) : new d(this.a, i2);
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.sequences.Sequence
|
|
|
|
public Iterator<T> iterator() {
|
|
|
|
return new a(this);
|
|
|
|
}
|
|
|
|
|
2021-11-02 06:38:17 +00:00
|
|
|
@Override // d0.f0.e
|
2021-08-03 07:33:18 +00:00
|
|
|
public Sequence<T> take(int i) {
|
2022-03-28 08:10:50 +00:00
|
|
|
int i2 = this.f3563b;
|
2021-08-03 07:33:18 +00:00
|
|
|
int i3 = i2 + i;
|
|
|
|
return i3 < 0 ? new s(this, i) : new r(this.a, i2, i3);
|
|
|
|
}
|
|
|
|
}
|