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.jvm.functions.Function1;
|
|
|
|
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 t<T> implements Sequence<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 Function1<T, Boolean> f3570b;
|
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 = -1;
|
|
|
|
public T l;
|
2021-08-03 07:33:18 +00:00
|
|
|
|
2022-03-07 09:34:54 +00:00
|
|
|
public a() {
|
|
|
|
this.j = t.access$getSequence$p(t.this).iterator();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final void a() {
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.j.hasNext()) {
|
|
|
|
T next = this.j.next();
|
2022-03-07 09:34:54 +00:00
|
|
|
if (((Boolean) t.access$getPredicate$p(t.this).invoke(next)).booleanValue()) {
|
2021-12-02 18:53:44 +00:00
|
|
|
this.k = 1;
|
|
|
|
this.l = next;
|
2021-08-03 07:33:18 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
this.k = 0;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.util.Iterator
|
|
|
|
public boolean hasNext() {
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.k == -1) {
|
2021-08-03 07:33:18 +00:00
|
|
|
a();
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
return this.k == 1;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // java.util.Iterator
|
|
|
|
public T next() {
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.k == -1) {
|
2021-08-03 07:33:18 +00:00
|
|
|
a();
|
|
|
|
}
|
2021-12-02 18:53:44 +00:00
|
|
|
if (this.k != 0) {
|
|
|
|
T t = this.l;
|
|
|
|
this.l = null;
|
|
|
|
this.k = -1;
|
2021-08-03 07:33:18 +00:00
|
|
|
return t;
|
|
|
|
}
|
|
|
|
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 t(Sequence<? extends T> sequence, Function1<? super T, Boolean> function1) {
|
|
|
|
m.checkNotNullParameter(sequence, "sequence");
|
|
|
|
m.checkNotNullParameter(function1, "predicate");
|
|
|
|
this.a = sequence;
|
2022-03-28 08:10:50 +00:00
|
|
|
this.f3570b = function1;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Function1 access$getPredicate$p(t tVar) {
|
2022-03-28 08:10:50 +00:00
|
|
|
return tVar.f3570b;
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public static final /* synthetic */ Sequence access$getSequence$p(t tVar) {
|
|
|
|
return tVar.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Override // kotlin.sequences.Sequence
|
|
|
|
public Iterator<T> iterator() {
|
2022-03-07 09:34:54 +00:00
|
|
|
return new a();
|
2021-08-03 07:33:18 +00:00
|
|
|
}
|
|
|
|
}
|