package jq;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

/* loaded from: classes3.dex */
public abstract class u0 {

    /* renamed from: a, reason: collision with root package name */
    private static final hq.e[] f25291a = new hq.e[0];

    public static final Set a(hq.e eVar) {
        kotlin.jvm.internal.t.g(eVar, "<this>");
        if (eVar instanceof j) {
            return ((j) eVar).a();
        }
        HashSet hashSet = new HashSet(eVar.k());
        int k10 = eVar.k();
        for (int i10 = 0; i10 < k10; i10++) {
            hashSet.add(eVar.l(i10));
        }
        return hashSet;
    }

    public static final hq.e[] b(List list) {
        hq.e[] eVarArr;
        List list2 = list;
        if (list2 == null || list2.isEmpty()) {
            list = null;
        }
        return (list == null || (eVarArr = (hq.e[]) list.toArray(new hq.e[0])) == null) ? f25291a : eVarArr;
    }
}
