mirror of
https://github.com/corda/corda.git
synced 2025-01-22 12:28:11 +00:00
EnumSet.allOf can take advantage of the bulk BitSet.set(start, end) operation to run faster instead of adding each element individually.
This commit is contained in:
parent
39ad6da290
commit
ba1719f1ef
@ -53,7 +53,7 @@ public class EnumSet<T extends Enum<T>> extends AbstractSet<T> {
|
|||||||
|
|
||||||
public static <T extends Enum<T>>EnumSet<T> allOf(Class<T> elementType) {
|
public static <T extends Enum<T>>EnumSet<T> allOf(Class<T> elementType) {
|
||||||
EnumSet<T> enumSet = createEmptyEnumSet(elementType);
|
EnumSet<T> enumSet = createEmptyEnumSet(elementType);
|
||||||
addAllElementsToSet(Arrays.asList(elementType.getEnumConstants()), enumSet);
|
enumSet.bitset.set(0, elementType.getEnumConstants().length);
|
||||||
|
|
||||||
return enumSet;
|
return enumSet;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user