49 lines
1.3 KiB
Java
49 lines
1.3 KiB
Java
package o;
|
|
|
|
/* loaded from: classes.dex */
|
|
public final class ggE<T> {
|
|
public int a;
|
|
private Object[] d = new Object[16];
|
|
public int e;
|
|
|
|
public final void b(T t) {
|
|
Object[] objArr = this.d;
|
|
int i = this.e;
|
|
objArr[i] = t;
|
|
int length = (objArr.length - 1) & (i + 1);
|
|
this.e = length;
|
|
if (length == this.a) {
|
|
b();
|
|
}
|
|
}
|
|
|
|
public final T c() {
|
|
int i = this.a;
|
|
if (i == this.e) {
|
|
return null;
|
|
}
|
|
Object[] objArr = this.d;
|
|
T t = (T) objArr[i];
|
|
objArr[i] = null;
|
|
this.a = (i + 1) & (objArr.length - 1);
|
|
if (t != null) {
|
|
return t;
|
|
}
|
|
throw new NullPointerException("null cannot be cast to non-null type T of kotlinx.coroutines.internal.ArrayQueue");
|
|
}
|
|
|
|
private final void b() {
|
|
Object[] objArr = this.d;
|
|
int length = objArr.length;
|
|
Object[] objArr2 = new Object[length << 1];
|
|
C14875gap.d(objArr, objArr2, 0, this.a, 0, 10);
|
|
Object[] objArr3 = this.d;
|
|
int length2 = objArr3.length;
|
|
int i = this.a;
|
|
C14875gap.d(objArr3, objArr2, length2 - i, 0, i, 4);
|
|
this.d = objArr2;
|
|
this.a = 0;
|
|
this.e = length;
|
|
}
|
|
}
|