Revert if-conditions to reduce indentation level

This commit is contained in:
Paul Schaub 2021-06-28 21:06:12 +02:00
parent e13a2fce73
commit 9395fa80a2
Signed by: vanitasvitae
GPG Key ID: 62BEE9264BF17311
1 changed files with 14 additions and 13 deletions

View File

@ -697,11 +697,12 @@ public class KeyRingInfo {
* @return true if all secret keys are unencrypted.
*/
public boolean isFullyDecrypted() {
if (isSecretKey()) {
for (PGPSecretKey secretKey : getSecretKeys()) {
if (!KeyInfo.hasDummyS2K(secretKey) && KeyInfo.isEncrypted(secretKey)) {
return false;
}
if (!isSecretKey()) {
return true;
}
for (PGPSecretKey secretKey : getSecretKeys()) {
if (!KeyInfo.hasDummyS2K(secretKey) && KeyInfo.isEncrypted(secretKey)) {
return false;
}
}
return true;
@ -716,15 +717,15 @@ public class KeyRingInfo {
* @return true if all secret keys are encrypted.
*/
public boolean isFullyEncrypted() {
if (isSecretKey()) {
for (PGPSecretKey secretKey : getSecretKeys()) {
if (!KeyInfo.hasDummyS2K(secretKey) && KeyInfo.isDecrypted(secretKey)) {
return false;
}
}
return true;
if (!isSecretKey()) {
return false;
}
return false;
for (PGPSecretKey secretKey : getSecretKeys()) {
if (!KeyInfo.hasDummyS2K(secretKey) && KeyInfo.isDecrypted(secretKey)) {
return false;
}
}
return true;
}
/**