- Added realracing3-community.apk (71.57 MB) - Removed 32-bit support (armeabi-v7a) - Only includes arm64-v8a libraries - Decompiled source code included - Added README-community.md with analysis
170 lines
6.9 KiB
Java
170 lines
6.9 KiB
Java
package kotlin.sequences;
|
|
|
|
import java.util.ArrayList;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import kotlin.collections.CollectionsKt__CollectionsJVMKt;
|
|
import kotlin.collections.CollectionsKt__CollectionsKt;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.text.StringsKt__AppendableKt;
|
|
|
|
/* loaded from: classes5.dex */
|
|
public abstract class SequencesKt___SequencesKt extends SequencesKt___SequencesJvmKt {
|
|
public static boolean contains(Sequence sequence, Object obj) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
return indexOf(sequence, obj) >= 0;
|
|
}
|
|
|
|
public static Object firstOrNull(Sequence sequence) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Iterator it = sequence.iterator();
|
|
if (it.hasNext()) {
|
|
return it.next();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
public static final int indexOf(Sequence sequence, Object obj) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
int i = 0;
|
|
for (Object obj2 : sequence) {
|
|
if (i < 0) {
|
|
CollectionsKt__CollectionsKt.throwIndexOverflow();
|
|
}
|
|
if (Intrinsics.areEqual(obj, obj2)) {
|
|
return i;
|
|
}
|
|
i++;
|
|
}
|
|
return -1;
|
|
}
|
|
|
|
public static Sequence filter(Sequence sequence, Function1 predicate) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
return new FilteringSequence(sequence, true, predicate);
|
|
}
|
|
|
|
public static final Sequence filterNot(Sequence sequence, Function1 predicate) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
return new FilteringSequence(sequence, false, predicate);
|
|
}
|
|
|
|
public static final Sequence filterNotNull(Sequence sequence) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Sequence filterNot = filterNot(sequence, new Function1() { // from class: kotlin.sequences.SequencesKt___SequencesKt$filterNotNull$1
|
|
@Override // kotlin.jvm.functions.Function1
|
|
public final Boolean invoke(Object obj) {
|
|
return Boolean.valueOf(obj == null);
|
|
}
|
|
});
|
|
Intrinsics.checkNotNull(filterNot, "null cannot be cast to non-null type kotlin.sequences.Sequence<T of kotlin.sequences.SequencesKt___SequencesKt.filterNotNull>");
|
|
return filterNot;
|
|
}
|
|
|
|
public static Sequence take(Sequence sequence, int i) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
if (i >= 0) {
|
|
if (i == 0) {
|
|
return SequencesKt__SequencesKt.emptySequence();
|
|
}
|
|
return sequence instanceof DropTakeSequence ? ((DropTakeSequence) sequence).take(i) : new TakeSequence(sequence, i);
|
|
}
|
|
throw new IllegalArgumentException(("Requested element count " + i + " is less than zero.").toString());
|
|
}
|
|
|
|
public static List toList(Sequence sequence) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Iterator it = sequence.iterator();
|
|
if (!it.hasNext()) {
|
|
return CollectionsKt__CollectionsKt.emptyList();
|
|
}
|
|
Object next = it.next();
|
|
if (!it.hasNext()) {
|
|
return CollectionsKt__CollectionsJVMKt.listOf(next);
|
|
}
|
|
ArrayList arrayList = new ArrayList();
|
|
arrayList.add(next);
|
|
while (it.hasNext()) {
|
|
arrayList.add(it.next());
|
|
}
|
|
return arrayList;
|
|
}
|
|
|
|
public static Sequence map(Sequence sequence, Function1 transform) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
|
return new TransformingSequence(sequence, transform);
|
|
}
|
|
|
|
public static Sequence mapNotNull(Sequence sequence, Function1 transform) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(transform, "transform");
|
|
return filterNotNull(new TransformingSequence(sequence, transform));
|
|
}
|
|
|
|
public static final Appendable joinTo(Sequence sequence, Appendable buffer, CharSequence separator, CharSequence prefix, CharSequence postfix, int i, CharSequence truncated, Function1 function1) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(buffer, "buffer");
|
|
Intrinsics.checkNotNullParameter(separator, "separator");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
Intrinsics.checkNotNullParameter(postfix, "postfix");
|
|
Intrinsics.checkNotNullParameter(truncated, "truncated");
|
|
buffer.append(prefix);
|
|
int i2 = 0;
|
|
for (Object obj : sequence) {
|
|
i2++;
|
|
if (i2 > 1) {
|
|
buffer.append(separator);
|
|
}
|
|
if (i >= 0 && i2 > i) {
|
|
break;
|
|
}
|
|
StringsKt__AppendableKt.appendElement(buffer, obj, function1);
|
|
}
|
|
if (i >= 0 && i2 > i) {
|
|
buffer.append(truncated);
|
|
}
|
|
buffer.append(postfix);
|
|
return buffer;
|
|
}
|
|
|
|
public static /* synthetic */ String joinToString$default(Sequence sequence, CharSequence charSequence, CharSequence charSequence2, CharSequence charSequence3, int i, CharSequence charSequence4, Function1 function1, int i2, Object obj) {
|
|
if ((i2 & 1) != 0) {
|
|
charSequence = ", ";
|
|
}
|
|
CharSequence charSequence5 = (i2 & 2) != 0 ? "" : charSequence2;
|
|
CharSequence charSequence6 = (i2 & 4) == 0 ? charSequence3 : "";
|
|
if ((i2 & 8) != 0) {
|
|
i = -1;
|
|
}
|
|
int i3 = i;
|
|
if ((i2 & 16) != 0) {
|
|
charSequence4 = "...";
|
|
}
|
|
CharSequence charSequence7 = charSequence4;
|
|
if ((i2 & 32) != 0) {
|
|
function1 = null;
|
|
}
|
|
return joinToString(sequence, charSequence, charSequence5, charSequence6, i3, charSequence7, function1);
|
|
}
|
|
|
|
public static final String joinToString(Sequence sequence, CharSequence separator, CharSequence prefix, CharSequence postfix, int i, CharSequence truncated, Function1 function1) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
Intrinsics.checkNotNullParameter(separator, "separator");
|
|
Intrinsics.checkNotNullParameter(prefix, "prefix");
|
|
Intrinsics.checkNotNullParameter(postfix, "postfix");
|
|
Intrinsics.checkNotNullParameter(truncated, "truncated");
|
|
String sb = ((StringBuilder) joinTo(sequence, new StringBuilder(), separator, prefix, postfix, i, truncated, function1)).toString();
|
|
Intrinsics.checkNotNullExpressionValue(sb, "toString(...)");
|
|
return sb;
|
|
}
|
|
|
|
public static Iterable asIterable(Sequence sequence) {
|
|
Intrinsics.checkNotNullParameter(sequence, "<this>");
|
|
return new SequencesKt___SequencesKt$asIterable$$inlined$Iterable$1(sequence);
|
|
}
|
|
}
|