package p040n;

/* renamed from: n.g */
/* loaded from: classes.dex */
public class C1487g<T> implements InterfaceC1486f<T> {

    /* renamed from: a */
    public final Object[] f3276a;

    /* renamed from: b */
    public int f3277b;

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

    @Override // p040n.InterfaceC1486f
    /* renamed from: a */
    public void mo1212a(T[] tArr, int i) {
        if (i > tArr.length) {
            i = tArr.length;
        }
        for (int i2 = 0; i2 < i; i2++) {
            T t = tArr[i2];
            int i3 = this.f3277b;
            Object[] objArr = this.f3276a;
            if (i3 < objArr.length) {
                objArr[i3] = t;
                this.f3277b = i3 + 1;
            }
        }
    }

    @Override // p040n.InterfaceC1486f
    /* renamed from: b */
    public boolean mo1211b(T t) {
        int i = this.f3277b;
        Object[] objArr = this.f3276a;
        if (i < objArr.length) {
            objArr[i] = t;
            this.f3277b = i + 1;
            return true;
        }
        return false;
    }

    @Override // p040n.InterfaceC1486f
    /* renamed from: c */
    public T mo1210c() {
        int i = this.f3277b;
        if (i > 0) {
            int i2 = i - 1;
            Object[] objArr = this.f3276a;
            T t = (T) objArr[i2];
            objArr[i2] = null;
            this.f3277b = i - 1;
            return t;
        }
        return null;
    }
}