package androidx.compose.foundation; import androidx.exifinterface.media.ExifInterface; import java.util.ArrayList; import java.util.List; import kotlin.Metadata; import kotlin.collections.CollectionsKt; import kotlin.jvm.functions.Function1; import kotlin.jvm.functions.Function2; import kotlin.jvm.internal.Intrinsics; /* compiled from: TempListUtils.kt */ @Metadata(d1 = {"\u00002\n\u0000\n\u0002\u0010 \n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0002\u0010\u000b\n\u0002\b\u0004\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0002\b\u0005\n\u0002\u0010\b\n\u0002\b\u0002\n\u0002\u0010\u000f\n\u0002\b\u0003\u001aA\u0010\u0000\u001a\b\u0012\u0004\u0012\u0002H\u00020\u0001\"\u0004\b\u0000\u0010\u0002*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0012\u0010\u0003\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u00020\u00050\u0004H\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0001\u001ac\u0010\u0006\u001a\u0002H\u0007\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0007*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0006\u0010\b\u001a\u0002H\u00072'\u0010\t\u001a#\u0012\u0013\u0012\u0011H\u0007¢\u0006\f\b\u000b\u0012\b\b\f\u0012\u0004\b\b(\r\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00070\nH\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0002¢\u0006\u0002\u0010\u000e\u001a^\u0010\u000f\u001a\b\u0012\u0004\u0012\u0002H\u00070\u0001\"\u0004\b\u0000\u0010\u0002\"\u0004\b\u0001\u0010\u0007*\b\u0012\u0004\u0012\u0002H\u00020\u00012)\u0010\u0010\u001a%\u0012\u0013\u0012\u00110\u0011¢\u0006\f\b\u000b\u0012\b\b\f\u0012\u0004\b\b(\u0012\u0012\u0004\u0012\u0002H\u0002\u0012\u0006\u0012\u0004\u0018\u0001H\u00070\nH\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0001\u001aR\u0010\u0013\u001a\u0004\u0018\u0001H\u0007\"\u0004\b\u0000\u0010\u0002\"\u000e\b\u0001\u0010\u0007*\b\u0012\u0004\u0012\u0002H\u00070\u0014*\b\u0012\u0004\u0012\u0002H\u00020\u00012\u0012\u0010\u0015\u001a\u000e\u0012\u0004\u0012\u0002H\u0002\u0012\u0004\u0012\u0002H\u00070\u0004H\u0080\bø\u0001\u0000\u0082\u0002\b\n\u0006\b\u0001\u0012\u0002\u0010\u0001¢\u0006\u0002\u0010\u0016\u0082\u0002\u0007\n\u0005\b\u009920\u0001¨\u0006\u0017"}, d2 = {"fastFilter", "", ExifInterface.GPS_DIRECTION_TRUE, "predicate", "Lkotlin/Function1;", "", "fastFold", "R", "initial", "operation", "Lkotlin/Function2;", "Lkotlin/ParameterName;", "name", "acc", "(Ljava/util/List;Ljava/lang/Object;Lkotlin/jvm/functions/Function2;)Ljava/lang/Object;", "fastMapIndexedNotNull", "transform", "", "index", "fastMaxOfOrNull", "", "selector", "(Ljava/util/List;Lkotlin/jvm/functions/Function1;)Ljava/lang/Comparable;", "foundation_release"}, k = 2, mv = {1, 8, 0}, xi = 48) /* loaded from: classes.dex */ public final class TempListUtilsKt { public static final List fastFilter(List list, Function1 predicate) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(predicate, "predicate"); ArrayList arrayList = new ArrayList(list.size()); int size = list.size(); for (int i = 0; i < size; i++) { T t = list.get(i); if (predicate.invoke(t).booleanValue()) { arrayList.add(t); } } return arrayList; } public static final List fastMapIndexedNotNull(List list, Function2 transform) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(transform, "transform"); ArrayList arrayList = new ArrayList(list.size()); int size = list.size(); for (int i = 0; i < size; i++) { R invoke = transform.invoke(Integer.valueOf(i), list.get(i)); if (invoke != null) { arrayList.add(invoke); } } return arrayList; } public static final > R fastMaxOfOrNull(List list, Function1 selector) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(selector, "selector"); if (list.isEmpty()) { return null; } R invoke = selector.invoke(list.get(0)); int lastIndex = CollectionsKt.getLastIndex(list); int i = 1; if (1 <= lastIndex) { while (true) { R invoke2 = selector.invoke(list.get(i)); if (invoke2.compareTo(invoke) > 0) { invoke = invoke2; } if (i == lastIndex) { break; } i++; } } return invoke; } public static final R fastFold(List list, R r, Function2 operation) { Intrinsics.checkNotNullParameter(list, ""); Intrinsics.checkNotNullParameter(operation, "operation"); int size = list.size(); for (int i = 0; i < size; i++) { r = operation.invoke(r, list.get(i)); } return r; } }