1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2024-11-25 22:02:05 +01:00

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

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;
}
}