package ῲ.ᨨ.㿎;

/* renamed from: ῲ.ᨨ.㿎.ඓ  reason: contains not printable characters */
/* compiled from: Pools */
public class C1866<T> implements AbstractC1871<T> {

    /* renamed from: ῲ  reason: contains not printable characters */
    public int f6312;

    /* renamed from: K  reason: contains not printable characters */
    public final Object[] f6313;

    public C1866(int i) {
        if (i > 0) {
            this.f6313 = new Object[i];
            return;
        }
        throw new IllegalArgumentException("The max pool size must be > 0");
    }

    @Override // ῲ.ᨨ.㿎.AbstractC1871
    /* renamed from: K  reason: contains not printable characters */
    public T m4826() {
        int i = this.f6312;
        if (i <= 0) {
            return null;
        }
        int i2 = i - 1;
        Object[] objArr = this.f6313;
        T t = (T) objArr[i2];
        objArr[i2] = null;
        this.f6312 = i - 1;
        return t;
    }

    @Override // ῲ.ᨨ.㿎.AbstractC1871
    /* renamed from: K  reason: contains not printable characters */
    public boolean m4827(T t) {
        boolean z;
        int i = 0;
        while (true) {
            if (i >= this.f6312) {
                z = false;
                break;
            } else if (this.f6313[i] == t) {
                z = true;
                break;
            } else {
                i++;
            }
        }
        if (!z) {
            int i2 = this.f6312;
            Object[] objArr = this.f6313;
            if (i2 >= objArr.length) {
                return false;
            }
            objArr[i2] = t;
            this.f6312 = i2 + 1;
            return true;
        }
        throw new IllegalStateException("Already in the pool!");
    }
}
