Files
rr3-apk/decompiled/sources/kotlin/sequences/GeneratorSequence$iterator$1.java
Daniel Elliott f9d20bb3fc Add decompiled APK source code (JADX)
- 28,932 files
- Full Java source code
- Smali files
- Resources

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-02-18 14:52:23 -08:00

64 lines
1.9 KiB
Java

package kotlin.sequences;
import java.util.Iterator;
import java.util.NoSuchElementException;
import kotlin.jvm.functions.Function0;
import kotlin.jvm.functions.Function1;
import kotlin.jvm.internal.Intrinsics;
import kotlin.jvm.internal.markers.KMappedMarker;
/* loaded from: classes5.dex */
public final class GeneratorSequence$iterator$1 implements Iterator, KMappedMarker {
public Object nextItem;
public int nextState = -2;
public final /* synthetic */ GeneratorSequence this$0;
@Override // java.util.Iterator
public void remove() {
throw new UnsupportedOperationException("Operation is not supported for read-only collection");
}
public GeneratorSequence$iterator$1(GeneratorSequence generatorSequence) {
this.this$0 = generatorSequence;
}
private final void calcNext() {
Function1 function1;
Object invoke;
Function0 function0;
if (this.nextState == -2) {
function0 = this.this$0.getInitialValue;
invoke = function0.invoke();
} else {
function1 = this.this$0.getNextValue;
Object obj = this.nextItem;
Intrinsics.checkNotNull(obj);
invoke = function1.invoke(obj);
}
this.nextItem = invoke;
this.nextState = invoke == null ? 0 : 1;
}
@Override // java.util.Iterator
public Object next() {
if (this.nextState < 0) {
calcNext();
}
if (this.nextState == 0) {
throw new NoSuchElementException();
}
Object obj = this.nextItem;
Intrinsics.checkNotNull(obj, "null cannot be cast to non-null type T of kotlin.sequences.GeneratorSequence");
this.nextState = -1;
return obj;
}
@Override // java.util.Iterator
public boolean hasNext() {
if (this.nextState < 0) {
calcNext();
}
return this.nextState == 1;
}
}