187 lines
4.8 KiB
Java
187 lines
4.8 KiB
Java
package o;
|
|
|
|
import com.airbnb.deeplinkdispatch.UrlTreeKt;
|
|
|
|
/* renamed from: o.Ltg, reason: case insensitive filesystem */
|
|
/* loaded from: classes.dex */
|
|
public class C0667Ltg<E> implements Cloneable {
|
|
public static final Object d = new Object();
|
|
public int a;
|
|
public boolean b;
|
|
public Object[] c;
|
|
public long[] e;
|
|
|
|
public C0667Ltg() {
|
|
this(10);
|
|
}
|
|
|
|
public C0667Ltg(int i) {
|
|
this.b = false;
|
|
if (i == 0) {
|
|
this.e = C6569cWs.a;
|
|
this.c = C6569cWs.d;
|
|
} else {
|
|
int e = C6569cWs.e(i);
|
|
this.e = new long[e];
|
|
this.c = new Object[e];
|
|
}
|
|
}
|
|
|
|
/* JADX INFO: Access modifiers changed from: private */
|
|
/* renamed from: d, reason: merged with bridge method [inline-methods] */
|
|
public C0667Ltg<E> clone() {
|
|
try {
|
|
C0667Ltg<E> c0667Ltg = (C0667Ltg) super.clone();
|
|
c0667Ltg.e = (long[]) this.e.clone();
|
|
c0667Ltg.c = (Object[]) this.c.clone();
|
|
return c0667Ltg;
|
|
} catch (CloneNotSupportedException e) {
|
|
throw new AssertionError(e);
|
|
}
|
|
}
|
|
|
|
public final E c(long j) {
|
|
E e;
|
|
int e2 = C6569cWs.e(this.e, this.a, j);
|
|
if (e2 < 0 || (e = (E) this.c[e2]) == d) {
|
|
return null;
|
|
}
|
|
return e;
|
|
}
|
|
|
|
public final void e(long j) {
|
|
int e = C6569cWs.e(this.e, this.a, j);
|
|
if (e >= 0) {
|
|
Object[] objArr = this.c;
|
|
Object obj = objArr[e];
|
|
Object obj2 = d;
|
|
if (obj != obj2) {
|
|
objArr[e] = obj2;
|
|
this.b = true;
|
|
}
|
|
}
|
|
}
|
|
|
|
public final void c() {
|
|
int i = this.a;
|
|
long[] jArr = this.e;
|
|
Object[] objArr = this.c;
|
|
int i2 = 0;
|
|
for (int i3 = 0; i3 < i; i3++) {
|
|
Object obj = objArr[i3];
|
|
if (obj != d) {
|
|
if (i3 != i2) {
|
|
jArr[i2] = jArr[i3];
|
|
objArr[i2] = obj;
|
|
objArr[i3] = null;
|
|
}
|
|
i2++;
|
|
}
|
|
}
|
|
this.b = false;
|
|
this.a = i2;
|
|
}
|
|
|
|
public final void c(long j, E e) {
|
|
int e2 = C6569cWs.e(this.e, this.a, j);
|
|
if (e2 >= 0) {
|
|
this.c[e2] = e;
|
|
return;
|
|
}
|
|
int i = ~e2;
|
|
int i2 = this.a;
|
|
if (i < i2) {
|
|
Object[] objArr = this.c;
|
|
if (objArr[i] == d) {
|
|
this.e[i] = j;
|
|
objArr[i] = e;
|
|
return;
|
|
}
|
|
}
|
|
if (this.b && i2 >= this.e.length) {
|
|
c();
|
|
i = ~C6569cWs.e(this.e, this.a, j);
|
|
}
|
|
int i3 = this.a;
|
|
if (i3 >= this.e.length) {
|
|
int e3 = C6569cWs.e(i3 + 1);
|
|
long[] jArr = new long[e3];
|
|
Object[] objArr2 = new Object[e3];
|
|
long[] jArr2 = this.e;
|
|
System.arraycopy(jArr2, 0, jArr, 0, jArr2.length);
|
|
Object[] objArr3 = this.c;
|
|
System.arraycopy(objArr3, 0, objArr2, 0, objArr3.length);
|
|
this.e = jArr;
|
|
this.c = objArr2;
|
|
}
|
|
int i4 = this.a - i;
|
|
if (i4 != 0) {
|
|
long[] jArr3 = this.e;
|
|
int i5 = i + 1;
|
|
System.arraycopy(jArr3, i, jArr3, i5, i4);
|
|
Object[] objArr4 = this.c;
|
|
System.arraycopy(objArr4, i, objArr4, i5, this.a - i);
|
|
}
|
|
this.e[i] = j;
|
|
this.c[i] = e;
|
|
this.a++;
|
|
}
|
|
|
|
public final int a() {
|
|
if (this.b) {
|
|
c();
|
|
}
|
|
return this.a;
|
|
}
|
|
|
|
public final boolean d(long j) {
|
|
if (this.b) {
|
|
c();
|
|
}
|
|
return C6569cWs.e(this.e, this.a, j) >= 0;
|
|
}
|
|
|
|
public final void b() {
|
|
int i = this.a;
|
|
Object[] objArr = this.c;
|
|
for (int i2 = 0; i2 < i; i2++) {
|
|
objArr[i2] = null;
|
|
}
|
|
this.a = 0;
|
|
this.b = false;
|
|
}
|
|
|
|
public String toString() {
|
|
if (this.b) {
|
|
c();
|
|
}
|
|
int i = this.a;
|
|
if (i <= 0) {
|
|
return "{}";
|
|
}
|
|
StringBuilder sb = new StringBuilder(i * 28);
|
|
sb.append(UrlTreeKt.componentParamPrefixChar);
|
|
for (int i2 = 0; i2 < this.a; i2++) {
|
|
if (i2 > 0) {
|
|
sb.append(", ");
|
|
}
|
|
if (this.b) {
|
|
c();
|
|
}
|
|
sb.append(this.e[i2]);
|
|
sb.append('=');
|
|
if (this.b) {
|
|
c();
|
|
}
|
|
Object obj = this.c[i2];
|
|
if (obj != this) {
|
|
sb.append(obj);
|
|
} else {
|
|
sb.append("(this Map)");
|
|
}
|
|
}
|
|
sb.append(UrlTreeKt.componentParamSuffixChar);
|
|
return sb.toString();
|
|
}
|
|
}
|