- 28,932 files - Full Java source code - Smali files - Resources Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
151 lines
4.0 KiB
Java
151 lines
4.0 KiB
Java
package com.applovin.impl;
|
|
|
|
import com.applovin.exoplayer2.common.base.Preconditions;
|
|
import java.util.Arrays;
|
|
import java.util.Collection;
|
|
import java.util.Set;
|
|
import java.util.SortedSet;
|
|
|
|
/* loaded from: classes.dex */
|
|
public abstract class ib extends cb implements Set {
|
|
private transient eb b;
|
|
|
|
private static boolean a(int i, int i2) {
|
|
return i < (i2 >> 1) + (i2 >> 2);
|
|
}
|
|
|
|
public static ib h() {
|
|
return oi.i;
|
|
}
|
|
|
|
public boolean g() {
|
|
return false;
|
|
}
|
|
|
|
@Override // com.applovin.impl.cb, java.util.AbstractCollection, java.util.Collection, java.lang.Iterable
|
|
public abstract pp iterator();
|
|
|
|
@Override // java.util.Collection, java.util.Set
|
|
public boolean equals(Object obj) {
|
|
if (obj == this) {
|
|
return true;
|
|
}
|
|
if ((obj instanceof ib) && g() && ((ib) obj).g() && hashCode() != obj.hashCode()) {
|
|
return false;
|
|
}
|
|
return rj.a(this, obj);
|
|
}
|
|
|
|
@Override // java.util.Collection, java.util.Set
|
|
public int hashCode() {
|
|
return rj.a(this);
|
|
}
|
|
|
|
@Override // com.applovin.impl.cb
|
|
public eb a() {
|
|
eb ebVar = this.b;
|
|
if (ebVar != null) {
|
|
return ebVar;
|
|
}
|
|
eb f = f();
|
|
this.b = f;
|
|
return f;
|
|
}
|
|
|
|
public eb f() {
|
|
return eb.a(toArray());
|
|
}
|
|
|
|
public static int a(int i) {
|
|
int max = Math.max(i, 2);
|
|
if (max < 751619276) {
|
|
int highestOneBit = Integer.highestOneBit(max - 1) << 1;
|
|
while (highestOneBit * 0.7d < max) {
|
|
highestOneBit <<= 1;
|
|
}
|
|
return highestOneBit;
|
|
}
|
|
Preconditions.checkArgument(max < 1073741824, "collection too large");
|
|
return 1073741824;
|
|
}
|
|
|
|
private static ib a(int i, Object... objArr) {
|
|
if (i == 0) {
|
|
return h();
|
|
}
|
|
if (i != 1) {
|
|
int a = a(i);
|
|
Object[] objArr2 = new Object[a];
|
|
int i2 = a - 1;
|
|
int i3 = 0;
|
|
int i4 = 0;
|
|
for (int i5 = 0; i5 < i; i5++) {
|
|
Object a2 = gg.a(objArr[i5], i5);
|
|
int hashCode = a2.hashCode();
|
|
int a3 = ka.a(hashCode);
|
|
while (true) {
|
|
int i6 = a3 & i2;
|
|
Object obj = objArr2[i6];
|
|
if (obj == null) {
|
|
objArr[i4] = a2;
|
|
objArr2[i6] = a2;
|
|
i3 += hashCode;
|
|
i4++;
|
|
break;
|
|
}
|
|
if (obj.equals(a2)) {
|
|
break;
|
|
}
|
|
a3++;
|
|
}
|
|
}
|
|
Arrays.fill(objArr, i4, i, (Object) null);
|
|
if (i4 == 1) {
|
|
return new hk(objArr[0], i3);
|
|
}
|
|
if (a(i4) < a / 2) {
|
|
return a(i4, objArr);
|
|
}
|
|
if (a(i4, objArr.length)) {
|
|
objArr = Arrays.copyOf(objArr, i4);
|
|
}
|
|
return new oi(objArr, i3, objArr2, i2, i4);
|
|
}
|
|
return a(objArr[0]);
|
|
}
|
|
|
|
public static ib a(Collection collection) {
|
|
if ((collection instanceof ib) && !(collection instanceof SortedSet)) {
|
|
ib ibVar = (ib) collection;
|
|
if (!ibVar.e()) {
|
|
return ibVar;
|
|
}
|
|
}
|
|
Object[] array = collection.toArray();
|
|
return a(array.length, array);
|
|
}
|
|
|
|
public static ib a(Object[] objArr) {
|
|
int length = objArr.length;
|
|
if (length == 0) {
|
|
return h();
|
|
}
|
|
if (length != 1) {
|
|
return a(objArr.length, (Object[]) objArr.clone());
|
|
}
|
|
return a(objArr[0]);
|
|
}
|
|
|
|
public static ib a(Object obj, Object obj2) {
|
|
return a(2, obj, obj2);
|
|
}
|
|
|
|
public static ib a(Object obj, Object obj2, Object obj3) {
|
|
return a(3, obj, obj2, obj3);
|
|
}
|
|
|
|
public static ib a(Object obj) {
|
|
return new hk(obj);
|
|
}
|
|
}
|