Use Set.of().
This commit is contained in:
parent
ae369ec9ba
commit
c53143ef4f
|
@ -2,7 +2,6 @@ package org.schabi.newpipe.util;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -20,6 +19,6 @@ public final class CookieUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Set<String> splitCookies(final String cookies) {
|
public static Set<String> splitCookies(final String cookies) {
|
||||||
return new HashSet<>(Arrays.asList(cookies.split("; *")));
|
return Set.of(cookies.split("; *"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,7 +22,6 @@ import java.util.Arrays;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.Comparator;
|
import java.util.Comparator;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -40,9 +39,8 @@ public final class ListHelper {
|
||||||
// Audio format in order of efficiency. 0=most efficient, n=least efficient
|
// Audio format in order of efficiency. 0=most efficient, n=least efficient
|
||||||
private static final List<MediaFormat> AUDIO_FORMAT_EFFICIENCY_RANKING =
|
private static final List<MediaFormat> AUDIO_FORMAT_EFFICIENCY_RANKING =
|
||||||
Arrays.asList(MediaFormat.WEBMA, MediaFormat.M4A, MediaFormat.MP3);
|
Arrays.asList(MediaFormat.WEBMA, MediaFormat.M4A, MediaFormat.MP3);
|
||||||
// Use a HashSet for better performance
|
// Use a Set for better performance
|
||||||
private static final Set<String> HIGH_RESOLUTION_LIST = new HashSet<>(
|
private static final Set<String> HIGH_RESOLUTION_LIST = Set.of("1440p", "2160p");
|
||||||
Arrays.asList("1440p", "2160p"));
|
|
||||||
|
|
||||||
private ListHelper() { }
|
private ListHelper() { }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue