92 lines
2.8 KiB
Java
92 lines
2.8 KiB
Java
|
package o;
|
||
|
|
||
|
import java.util.ArrayList;
|
||
|
import java.util.Arrays;
|
||
|
import java.util.Collections;
|
||
|
import java.util.List;
|
||
|
|
||
|
/* renamed from: o.gay, reason: case insensitive filesystem */
|
||
|
/* loaded from: classes.dex */
|
||
|
public class C14884gay extends C14880gau {
|
||
|
public static final <T> List<T> e(T... tArr) {
|
||
|
C14957gcv.e(tArr, "");
|
||
|
if (tArr.length > 0) {
|
||
|
C14957gcv.e(tArr, "");
|
||
|
List<T> asList = Arrays.asList(tArr);
|
||
|
C14957gcv.c(asList, "");
|
||
|
return asList;
|
||
|
}
|
||
|
return C14851gaI.c;
|
||
|
}
|
||
|
|
||
|
public static final <T> List<T> d(T... tArr) {
|
||
|
C14957gcv.e(tArr, "");
|
||
|
return tArr.length == 0 ? new ArrayList() : new ArrayList(new C14873gan(tArr, true));
|
||
|
}
|
||
|
|
||
|
public static final <T> ArrayList<T> c(T... tArr) {
|
||
|
C14957gcv.e(tArr, "");
|
||
|
return tArr.length == 0 ? new ArrayList<>() : new ArrayList<>(new C14873gan(tArr, true));
|
||
|
}
|
||
|
|
||
|
/* JADX WARN: Multi-variable type inference failed */
|
||
|
public static final <T> List<T> a(List<? extends T> list) {
|
||
|
C14957gcv.e(list, "");
|
||
|
int size = list.size();
|
||
|
if (size == 0) {
|
||
|
return C14851gaI.c;
|
||
|
}
|
||
|
if (size != 1) {
|
||
|
return list;
|
||
|
}
|
||
|
List<T> singletonList = Collections.singletonList(list.get(0));
|
||
|
C14957gcv.c(singletonList, "");
|
||
|
return singletonList;
|
||
|
}
|
||
|
|
||
|
public static /* synthetic */ int e(List list, Comparable comparable) {
|
||
|
int size = list.size();
|
||
|
C14957gcv.e(list, "");
|
||
|
int size2 = list.size();
|
||
|
if (size < 0) {
|
||
|
StringBuilder sb = new StringBuilder("fromIndex (0) is greater than toIndex (");
|
||
|
sb.append(size);
|
||
|
sb.append(").");
|
||
|
throw new IllegalArgumentException(sb.toString());
|
||
|
}
|
||
|
if (size > size2) {
|
||
|
StringBuilder sb2 = new StringBuilder("toIndex (");
|
||
|
sb2.append(size);
|
||
|
sb2.append(") is greater than size (");
|
||
|
sb2.append(size2);
|
||
|
sb2.append(").");
|
||
|
throw new IndexOutOfBoundsException(sb2.toString());
|
||
|
}
|
||
|
int i = size - 1;
|
||
|
int i2 = 0;
|
||
|
while (true) {
|
||
|
int i3 = 1;
|
||
|
if (i2 > i) {
|
||
|
return -(i2 + 1);
|
||
|
}
|
||
|
int i4 = (i2 + i) >>> 1;
|
||
|
Comparable comparable2 = (Comparable) list.get(i4);
|
||
|
if (comparable2 == comparable) {
|
||
|
i3 = 0;
|
||
|
} else if (comparable2 == null) {
|
||
|
i3 = -1;
|
||
|
} else if (comparable != null) {
|
||
|
i3 = comparable2.compareTo(comparable);
|
||
|
}
|
||
|
if (i3 < 0) {
|
||
|
i2 = i4 + 1;
|
||
|
} else {
|
||
|
if (i3 <= 0) {
|
||
|
return i4;
|
||
|
}
|
||
|
i = i4 - 1;
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|