package h.b.o;

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

/* JADX INFO: compiled from: Platform.common.kt */
/* JADX INFO: loaded from: classes.dex */
@g.i
public final class y0 {
    public static final h.b.m.e[] a = new h.b.m.e[0];

    public static final Set<String> a(h.b.m.e eVar) {
        g.h0.c.l.f(eVar, "<this>");
        if (eVar instanceof l) {
            return ((l) eVar).b();
        }
        HashSet hashSet = new HashSet(eVar.f());
        int iF = eVar.f();
        for (int i2 = 0; i2 < iF; i2++) {
            hashSet.add(eVar.g(i2));
        }
        return hashSet;
    }

    public static final h.b.m.e[] b(List<? extends h.b.m.e> list) {
        if (list == null || list.isEmpty()) {
            list = null;
        }
        if (list == null) {
            return a;
        }
        Object[] array = list.toArray(new h.b.m.e[0]);
        g.h0.c.l.d(array, "null cannot be cast to non-null type kotlin.Array<T of kotlin.collections.ArraysKt__ArraysJVMKt.toTypedArray>");
        return (h.b.m.e[]) array;
    }
}
