discord-jadx/app/src/main/java/d0/f0/s.java

81 lines
2.3 KiB
Java
Raw Normal View History

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 java.util.NoSuchElementException;
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 s<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 f3569b;
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 int j;
public final Iterator<T> k;
2021-08-03 07:33:18 +00:00
public a(s sVar) {
2021-12-02 18:53:44 +00:00
this.j = s.access$getCount$p(sVar);
this.k = s.access$getSequence$p(sVar).iterator();
2021-08-03 07:33:18 +00:00
}
@Override // java.util.Iterator
public boolean hasNext() {
2021-12-02 18:53:44 +00:00
return this.j > 0 && this.k.hasNext();
2021-08-03 07:33:18 +00:00
}
@Override // java.util.Iterator
public T next() {
2021-12-02 18:53:44 +00:00
int i = this.j;
2021-08-03 07:33:18 +00:00
if (i != 0) {
2021-12-02 18:53:44 +00:00
this.j = i - 1;
return this.k.next();
2021-08-03 07:33:18 +00:00
}
throw new NoSuchElementException();
}
@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 s(Sequence<? extends T> sequence, int i) {
m.checkNotNullParameter(sequence, "sequence");
this.a = sequence;
2022-03-28 08:10:50 +00:00
this.f3569b = 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(s sVar) {
2022-03-28 08:10:50 +00:00
return sVar.f3569b;
2021-08-03 07:33:18 +00:00
}
public static final /* synthetic */ Sequence access$getSequence$p(s sVar) {
return sVar.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.f3569b;
2021-08-03 07:33:18 +00:00
return i >= i2 ? n.emptySequence() : new r(this.a, i, 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
return i >= this.f3569b ? this : new s(this.a, i);
2021-08-03 07:33:18 +00:00
}
}