* Decompile and recreate Soul Browser v1.4.85 with APK CI builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix CI build: include bundled google.jks and remove PR trigger The apktool build failed in CI because app/unknown/.../google.jks was excluded by the *.jks gitignore rule. Whitelist app-bundled JKS files and commit the missing resource. Also remove the redundant pull_request workflow trigger. Co-authored-by: KaKi87 <KaKi87@pm.me> * Change package ID to com.github.kaki87.soulbrowser Rename the application ID so the rebuilt APK can be installed alongside the original Soul Browser from Google Play. - Update AndroidManifest package, permissions, providers, and actions - Update R class references in smali (com/github/kaki87/soulbrowser/R) - Update shortcuts.xml targetPackage - Rename app label to "Soul Rebuild" for easy identification Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install compatibility: remove split APK metadata and bundle native libs The rebuilt APK still declared requiredSplitTypes and Play Store split metadata, causing Android to reject standalone installs as incompatible. - Remove requiredSplitTypes and split-related manifest meta-data - Merge native libs from all ABI splits with uncompressed storage - Page-align before signing for extractNativeLibs=false - Add .so to apktool doNotCompress list Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix install failure: use apksigner v2/v3 and bundle arm64 native libs Target SDK 36 requires APK Signature Scheme v2+, but jarsigner only produces v1 signatures, causing Android to reject the install. - Sign with apksigner (v1+v2+v3) instead of jarsigner - Add arm64-v8a native libraries from universal Soul Browser 1.4.79 - Set extractNativeLibs=true for reliable sideload installs - Commit stable debug keystore for consistent signatures across builds Co-authored-by: KaKi87 <KaKi87@pm.me> * Add committed debug keystore for consistent APK signatures Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix startup crash: use original classes2.dex desugar libraries Apktool recompiles smali_classes2 into a broken classes2.dex, causing ClassNotFoundException for j$.com.android.tools.r8.a at ML Kit init. Inject the original classes2.dex (Java 8+ desugar libs) after apktool build instead of using the recompiled version. Co-authored-by: KaKi87 <KaKi87@pm.me> * Fix missing drawable resources from density split APKs The base APK is an app bundle module; density-specific drawables like seek_thumb_nor_b live in config.xhdpi.apk and were missing after rebuild, causing Resources$NotFoundException at runtime. - Merge non-9-patch resources from split APKs before apktool build - Sync public.xml IDs from R smali only when backing files exist - Add 713 density-specific resource IDs to public.xml Co-authored-by: KaKi87 <KaKi87@pm.me> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
318 lines
21 KiB
Java
318 lines
21 KiB
Java
package kotlin.collections;
|
|
|
|
import com.google.android.gms.ads.RequestConfiguration;
|
|
import java.util.Collection;
|
|
import java.util.Iterator;
|
|
import java.util.List;
|
|
import java.util.NoSuchElementException;
|
|
import java.util.RandomAccess;
|
|
import kotlin.Deprecated;
|
|
import kotlin.DeprecationLevel;
|
|
import kotlin.Metadata;
|
|
import kotlin.ReplaceWith;
|
|
import kotlin.SinceKotlin;
|
|
import kotlin.internal.InlineOnly;
|
|
import kotlin.jvm.functions.Function1;
|
|
import kotlin.jvm.internal.Intrinsics;
|
|
import kotlin.jvm.internal.TypeIntrinsics;
|
|
import kotlin.sequences.Sequence;
|
|
import kotlin.sequences.SequencesKt;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
/* JADX INFO: Access modifiers changed from: package-private */
|
|
@Metadata(d1 = {"\u0000P\n\u0000\n\u0002\u0010\u000b\n\u0000\n\u0002\u0018\u0002\n\u0002\u0010\u001f\n\u0002\b\u0004\n\u0002\u0010\u001e\n\u0002\b\u0002\n\u0002\u0010\u0002\n\u0000\n\u0002\u0010\u001c\n\u0002\u0010\u0011\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0006\n\u0002\u0010\u001d\n\u0000\n\u0002\u0018\u0002\n\u0002\b\u0003\n\u0002\u0010!\n\u0000\n\u0002\u0010\b\n\u0002\b\u0007\u001a-\u0010\u0000\u001a\u00020\u0001\"\t\b\u0000\u0010\u0002¢\u0006\u0002\b\u0003*\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u00042\u0006\u0010\u0005\u001a\u0002H\u0002H\u0087\b¢\u0006\u0002\u0010\u0006\u001a.\u0010\u0007\u001a\u00020\u0001\"\t\b\u0000\u0010\u0002¢\u0006\u0002\b\u0003*\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\tH\u0087\b\u001a.\u0010\n\u001a\u00020\u0001\"\t\b\u0000\u0010\u0002¢\u0006\u0002\b\u0003*\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\tH\u0087\b\u001a(\u0010\u000b\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\u0006\u0010\u0005\u001a\u0002H\u0002H\u0087\n¢\u0006\u0002\u0010\r\u001a)\u0010\u000b\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u000eH\u0087\n\u001a.\u0010\u000b\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u000fH\u0087\n¢\u0006\u0002\u0010\u0010\u001a)\u0010\u000b\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0011H\u0087\n\u001a(\u0010\u0012\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\u0006\u0010\u0005\u001a\u0002H\u0002H\u0087\n¢\u0006\u0002\u0010\r\u001a)\u0010\u0012\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u000eH\u0087\n\u001a.\u0010\u0012\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u000fH\u0087\n¢\u0006\u0002\u0010\u0010\u001a)\u0010\u0012\u001a\u00020\f\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0011H\u0087\n\u001a&\u0010\u0013\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u000e\u001a&\u0010\u0013\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0011\u001a-\u0010\u0013\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\u000e\u0010\b\u001a\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u000f¢\u0006\u0002\u0010\u0014\u001a\u001e\u0010\u0015\u001a\b\u0012\u0004\u0012\u0002H\u00020\t\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u000eH\u0000\u001a&\u0010\u0007\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u000e\u001a&\u0010\u0007\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0011\u001a-\u0010\u0007\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\u000e\u0010\b\u001a\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u000f¢\u0006\u0002\u0010\u0014\u001a&\u0010\n\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u000e\u001a-\u0010\n\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\u000e\u0010\b\u001a\n\u0012\u0006\b\u0001\u0012\u0002H\u00020\u000f¢\u0006\u0002\u0010\u0014\u001a&\u0010\n\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\n\u0012\u0006\b\u0000\u0012\u0002H\u00020\u00042\f\u0010\b\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0011\u001a\u0015\u0010\u0016\u001a\u00020\u0001*\u0006\u0012\u0002\b\u00030\u0004H\u0002¢\u0006\u0002\b\u0017\u001a*\u0010\u0007\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00182\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u001a\u001a*\u0010\n\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00182\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u001a\u001a9\u0010\u001b\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00182\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u001a2\u0006\u0010\u001c\u001a\u00020\u0001H\u0002¢\u0006\u0002\b\u001d\u001a&\u0010\u0000\u001a\u0002H\u0002\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001e2\u0006\u0010\u001f\u001a\u00020 H\u0087\b¢\u0006\u0002\u0010!\u001a\u001d\u0010\"\u001a\u0002H\u0002\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001eH\u0007¢\u0006\u0002\u0010#\u001a\u001f\u0010$\u001a\u0004\u0018\u0001H\u0002\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001eH\u0007¢\u0006\u0002\u0010#\u001a\u001d\u0010%\u001a\u0002H\u0002\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001eH\u0007¢\u0006\u0002\u0010#\u001a\u001f\u0010&\u001a\u0004\u0018\u0001H\u0002\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001eH\u0007¢\u0006\u0002\u0010#\u001a*\u0010\u0007\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001e2\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u001a\u001a*\u0010\n\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001e2\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u001a\u001a9\u0010\u001b\u001a\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u001e2\u0012\u0010\u0019\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00010\u001a2\u0006\u0010\u001c\u001a\u00020\u0001H\u0002¢\u0006\u0002\b\u001d¨\u0006'"}, d2 = {"remove", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, RequestConfiguration.MAX_AD_CONTENT_RATING_T, "Lkotlin/internal/OnlyInputTypes;", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "element", "(Ljava/util/Collection;Ljava/lang/Object;)Z", "removeAll", "elements", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "retainAll", "plusAssign", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "(Ljava/util/Collection;Ljava/lang/Object;)V", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "(Ljava/util/Collection;[Ljava/lang/Object;)V", "Lkotlin/sequences/Sequence;", "minusAssign", "addAll", "(Ljava/util/Collection;[Ljava/lang/Object;)Z", "convertToListIfNotCollection", "retainNothing", "retainNothing$CollectionsKt__MutableCollectionsKt", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "predicate", "Lkotlin/Function1;", "filterInPlace", "predicateResultToRemove", "filterInPlace$CollectionsKt__MutableCollectionsKt", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "index", RequestConfiguration.MAX_AD_CONTENT_RATING_UNSPECIFIED, "(Ljava/util/List;I)Ljava/lang/Object;", "removeFirst", "(Ljava/util/List;)Ljava/lang/Object;", "removeFirstOrNull", "removeLast", "removeLastOrNull", "kotlin-stdlib"}, k = 5, mv = {2, 2, 0}, xi = 49, xs = "kotlin/collections/CollectionsKt")
|
|
/* loaded from: classes3.dex */
|
|
public class CollectionsKt__MutableCollectionsKt extends CollectionsKt__MutableCollectionsJVMKt {
|
|
public static <T> boolean addAll(@NotNull Collection<? super T> collection, @NotNull Iterable<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
if (elements instanceof Collection) {
|
|
return collection.addAll((Collection) elements);
|
|
}
|
|
Iterator<? extends T> it = elements.iterator();
|
|
boolean z = false;
|
|
while (it.hasNext()) {
|
|
if (collection.add(it.next())) {
|
|
z = true;
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
|
|
@NotNull
|
|
public static <T> Collection<T> convertToListIfNotCollection(@NotNull Iterable<? extends T> iterable) {
|
|
Intrinsics.checkNotNullParameter(iterable, "<this>");
|
|
if (iterable instanceof Collection) {
|
|
return (Collection) iterable;
|
|
}
|
|
return CollectionsKt___CollectionsKt.toList(iterable);
|
|
}
|
|
|
|
private static final <T> boolean filterInPlace$CollectionsKt__MutableCollectionsKt(Iterable<? extends T> iterable, Function1<? super T, Boolean> function1, boolean z) {
|
|
Iterator<? extends T> it = iterable.iterator();
|
|
boolean z2 = false;
|
|
while (it.hasNext()) {
|
|
if (function1.invoke(it.next()).booleanValue() == z) {
|
|
it.remove();
|
|
z2 = true;
|
|
}
|
|
}
|
|
return z2;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> void minusAssign(Collection<? super T> collection, T t) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
collection.remove(t);
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
@InlineOnly
|
|
private static final <T> void plusAssign(Collection<? super T> collection, T t) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
collection.add(t);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> boolean remove(Collection<? extends T> collection, T t) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
return TypeIntrinsics.asMutableCollection(collection).remove(t);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> boolean removeAll(Collection<? extends T> collection, Collection<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
return TypeIntrinsics.asMutableCollection(collection).removeAll(elements);
|
|
}
|
|
|
|
@SinceKotlin(version = "1.4")
|
|
public static final <T> T removeFirst(@NotNull List<T> list) {
|
|
Intrinsics.checkNotNullParameter(list, "<this>");
|
|
if (!list.isEmpty()) {
|
|
return list.remove(0);
|
|
}
|
|
throw new NoSuchElementException("List is empty.");
|
|
}
|
|
|
|
@SinceKotlin(version = "1.4")
|
|
@Nullable
|
|
public static final <T> T removeFirstOrNull(@NotNull List<T> list) {
|
|
Intrinsics.checkNotNullParameter(list, "<this>");
|
|
if (list.isEmpty()) {
|
|
return null;
|
|
}
|
|
return list.remove(0);
|
|
}
|
|
|
|
@SinceKotlin(version = "1.4")
|
|
public static <T> T removeLast(@NotNull List<T> list) {
|
|
Intrinsics.checkNotNullParameter(list, "<this>");
|
|
if (!list.isEmpty()) {
|
|
return list.remove(CollectionsKt__CollectionsKt.getLastIndex(list));
|
|
}
|
|
throw new NoSuchElementException("List is empty.");
|
|
}
|
|
|
|
@SinceKotlin(version = "1.4")
|
|
@Nullable
|
|
public static <T> T removeLastOrNull(@NotNull List<T> list) {
|
|
Intrinsics.checkNotNullParameter(list, "<this>");
|
|
if (list.isEmpty()) {
|
|
return null;
|
|
}
|
|
return list.remove(CollectionsKt__CollectionsKt.getLastIndex(list));
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> boolean retainAll(Collection<? extends T> collection, Collection<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
return TypeIntrinsics.asMutableCollection(collection).retainAll(elements);
|
|
}
|
|
|
|
private static final boolean retainNothing$CollectionsKt__MutableCollectionsKt(Collection<?> collection) {
|
|
boolean z = !collection.isEmpty();
|
|
collection.clear();
|
|
return z;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> void minusAssign(Collection<? super T> collection, Iterable<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
removeAll(collection, elements);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> void plusAssign(Collection<? super T> collection, Iterable<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
addAll(collection, elements);
|
|
}
|
|
|
|
@Deprecated(level = DeprecationLevel.ERROR, message = "Use removeAt(index) instead.", replaceWith = @ReplaceWith(expression = "removeAt(index)", imports = {}))
|
|
@InlineOnly
|
|
private static final <T> T remove(List<T> list, int i) {
|
|
Intrinsics.checkNotNullParameter(list, "<this>");
|
|
return list.remove(i);
|
|
}
|
|
|
|
public static final <T> boolean removeAll(@NotNull Collection<? super T> collection, @NotNull Iterable<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
return collection.removeAll(convertToListIfNotCollection(elements));
|
|
}
|
|
|
|
public static final <T> boolean retainAll(@NotNull Collection<? super T> collection, @NotNull Iterable<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
return collection.retainAll(convertToListIfNotCollection(elements));
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> void minusAssign(Collection<? super T> collection, T[] elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
removeAll(collection, elements);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> void plusAssign(Collection<? super T> collection, T[] elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
addAll(collection, elements);
|
|
}
|
|
|
|
public static final <T> boolean removeAll(@NotNull Collection<? super T> collection, @NotNull Sequence<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
List list = SequencesKt.toList(elements);
|
|
return !list.isEmpty() && collection.removeAll(list);
|
|
}
|
|
|
|
public static final <T> boolean retainAll(@NotNull Collection<? super T> collection, @NotNull T[] elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
if (!(elements.length == 0)) {
|
|
return collection.retainAll(ArraysKt___ArraysJvmKt.asList(elements));
|
|
}
|
|
return retainNothing$CollectionsKt__MutableCollectionsKt(collection);
|
|
}
|
|
|
|
public static <T> boolean addAll(@NotNull Collection<? super T> collection, @NotNull Sequence<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
Iterator<? extends T> it = elements.iterator();
|
|
boolean z = false;
|
|
while (it.hasNext()) {
|
|
if (collection.add(it.next())) {
|
|
z = true;
|
|
}
|
|
}
|
|
return z;
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> void minusAssign(Collection<? super T> collection, Sequence<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
removeAll(collection, elements);
|
|
}
|
|
|
|
@InlineOnly
|
|
private static final <T> void plusAssign(Collection<? super T> collection, Sequence<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
addAll(collection, elements);
|
|
}
|
|
|
|
private static final <T> boolean filterInPlace$CollectionsKt__MutableCollectionsKt(List<T> list, Function1<? super T, Boolean> function1, boolean z) {
|
|
int i;
|
|
if (!(list instanceof RandomAccess)) {
|
|
Intrinsics.checkNotNull(list, "null cannot be cast to non-null type kotlin.collections.MutableIterable<T of kotlin.collections.CollectionsKt__MutableCollectionsKt.filterInPlace>");
|
|
return filterInPlace$CollectionsKt__MutableCollectionsKt(TypeIntrinsics.asMutableIterable(list), function1, z);
|
|
}
|
|
int lastIndex = CollectionsKt__CollectionsKt.getLastIndex(list);
|
|
if (lastIndex >= 0) {
|
|
int i2 = 0;
|
|
i = 0;
|
|
while (true) {
|
|
T t = list.get(i2);
|
|
if (function1.invoke(t).booleanValue() != z) {
|
|
if (i != i2) {
|
|
list.set(i, t);
|
|
}
|
|
i++;
|
|
}
|
|
if (i2 == lastIndex) {
|
|
break;
|
|
}
|
|
i2++;
|
|
}
|
|
} else {
|
|
i = 0;
|
|
}
|
|
if (i >= list.size()) {
|
|
return false;
|
|
}
|
|
int lastIndex2 = CollectionsKt__CollectionsKt.getLastIndex(list);
|
|
if (i > lastIndex2) {
|
|
return true;
|
|
}
|
|
while (true) {
|
|
list.remove(lastIndex2);
|
|
if (lastIndex2 == i) {
|
|
return true;
|
|
}
|
|
lastIndex2--;
|
|
}
|
|
}
|
|
|
|
public static final <T> boolean removeAll(@NotNull Collection<? super T> collection, @NotNull T[] elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
return !(elements.length == 0) && collection.removeAll(ArraysKt___ArraysJvmKt.asList(elements));
|
|
}
|
|
|
|
public static <T> boolean addAll(@NotNull Collection<? super T> collection, @NotNull T[] elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
return collection.addAll(ArraysKt___ArraysJvmKt.asList(elements));
|
|
}
|
|
|
|
public static final <T> boolean removeAll(@NotNull Iterable<? extends T> iterable, @NotNull Function1<? super T, Boolean> predicate) {
|
|
Intrinsics.checkNotNullParameter(iterable, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
return filterInPlace$CollectionsKt__MutableCollectionsKt((Iterable) iterable, (Function1) predicate, true);
|
|
}
|
|
|
|
public static final <T> boolean retainAll(@NotNull Collection<? super T> collection, @NotNull Sequence<? extends T> elements) {
|
|
Intrinsics.checkNotNullParameter(collection, "<this>");
|
|
Intrinsics.checkNotNullParameter(elements, "elements");
|
|
List list = SequencesKt.toList(elements);
|
|
if (!list.isEmpty()) {
|
|
return collection.retainAll(list);
|
|
}
|
|
return retainNothing$CollectionsKt__MutableCollectionsKt(collection);
|
|
}
|
|
|
|
public static final <T> boolean removeAll(@NotNull List<T> list, @NotNull Function1<? super T, Boolean> predicate) {
|
|
Intrinsics.checkNotNullParameter(list, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
return filterInPlace$CollectionsKt__MutableCollectionsKt((List) list, (Function1) predicate, true);
|
|
}
|
|
|
|
public static <T> boolean retainAll(@NotNull Iterable<? extends T> iterable, @NotNull Function1<? super T, Boolean> predicate) {
|
|
Intrinsics.checkNotNullParameter(iterable, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
return filterInPlace$CollectionsKt__MutableCollectionsKt((Iterable) iterable, (Function1) predicate, false);
|
|
}
|
|
|
|
public static final <T> boolean retainAll(@NotNull List<T> list, @NotNull Function1<? super T, Boolean> predicate) {
|
|
Intrinsics.checkNotNullParameter(list, "<this>");
|
|
Intrinsics.checkNotNullParameter(predicate, "predicate");
|
|
return filterInPlace$CollectionsKt__MutableCollectionsKt((List) list, (Function1) predicate, false);
|
|
}
|
|
}
|