DeterministicKeyChain: convert if-else in getEarliestKeyCreationTimeInstant() to terniary operator

This commit is contained in:
Andreas Schildbach 2023-03-08 20:31:15 +01:00
parent 2cd239eee0
commit 9ba34fc2ed

View File

@ -711,10 +711,10 @@ public class DeterministicKeyChain implements EncryptableKeyChain {
@Override
public Instant getEarliestKeyCreationTimeInstant() {
if (seed != null)
return Instant.ofEpochSecond(seed.getCreationTimeSeconds());
else
return Instant.ofEpochSecond(getWatchingKey().getCreationTimeSeconds());
return Instant.ofEpochSecond(seed != null ?
seed.getCreationTimeSeconds() :
getWatchingKey().getCreationTimeSeconds()
);
}
@Override