package c.l;

import java.util.Collection;
import java.util.Iterator;

/* JADX INFO: Access modifiers changed from: package-private */
/* JADX INFO: compiled from: MutableCollections.kt */
/* JADX INFO: loaded from: classes.dex */
public class o extends n {
    public static <T> boolean o(Collection<? super T> collection, Iterable<? extends T> iterable) {
        c.q.d.j.c(collection, "$this$addAll");
        c.q.d.j.c(iterable, "elements");
        if (iterable instanceof Collection) {
            return collection.addAll((Collection) iterable);
        }
        boolean z = false;
        Iterator<? extends T> it = iterable.iterator();
        while (it.hasNext()) {
            if (collection.add(it.next())) {
                z = true;
            }
        }
        return z;
    }

    public static <T> boolean p(Collection<? super T> collection, T[] tArr) {
        c.q.d.j.c(collection, "$this$addAll");
        c.q.d.j.c(tArr, "elements");
        return collection.addAll(e.a(tArr));
    }
}
