Return list in KeyFlag.fromInteger

This commit is contained in:
Paul Schaub 2018-06-21 15:18:48 +02:00
parent 29fbf21d01
commit 9d9edbfd9d
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 2 additions and 2 deletions

View File

@ -41,13 +41,13 @@ public enum KeyFlag {
return flag;
}
public static KeyFlag[] fromInteger(int bitmask) {
public static List<KeyFlag> fromInteger(int bitmask) {
List<KeyFlag> flags = new ArrayList<>();
for (KeyFlag f : KeyFlag.values()) {
if ((bitmask & f.flag) != 0) {
flags.add(f);
}
}
return flags.toArray(new KeyFlag[]{});
return flags;
}
}