Slightly optimise MUtil list and set
This commit is contained in:
parent
4cef1206e5
commit
8c5f6055a4
@ -1371,13 +1371,17 @@ public class MUtil
|
|||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
public static <T> List<T> list(T... items)
|
public static <T> List<T> list(T... items)
|
||||||
{
|
{
|
||||||
return new MassiveList<T>(Arrays.asList(items));
|
List<T> ret = new MassiveList<T>(items.length);
|
||||||
|
Collections.addAll(ret, items);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SafeVarargs
|
@SafeVarargs
|
||||||
public static <T> Set<T> set(T... items)
|
public static <T> Set<T> set(T... items)
|
||||||
{
|
{
|
||||||
return new MassiveSet<T>(Arrays.asList(items));
|
Set<T> ret = new MassiveSet<T>(items.length);
|
||||||
|
Collections.addAll(ret, items);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Set<String> treeset(String... items)
|
public static Set<String> treeset(String... items)
|
||||||
|
Loading…
Reference in New Issue
Block a user