simplify private function

Co-authored-by: Sebastian Stenzel <overheadhunter@users.noreply.github.com>
This commit is contained in:
Armin Schrenk
2021-03-29 12:44:57 +02:00
committed by GitHub
parent 786d156b9f
commit f77b237e59

View File

@@ -93,17 +93,9 @@ public class VaultListController implements FxController {
selectedVaultState.bind(newValue.stateProperty());
}
private boolean selectedVaultIsInState(VaultState other, VaultState... others) {
final var state = selectedVaultState.get();
if (state == null) {
return false;
} else {
boolean result = (state == other);
for (VaultState o : others) {
result |= (state == o);
}
return result;
}
private boolean selectedVaultIsInState(VaultState... states) {
var state = selectedVaultState.get();
return Arrays.stream(states).anyMatch(s -> state == s);
}