Optimize getAccessFor method

This commit is contained in:
AsamK 2021-12-25 16:07:27 +01:00
parent 7e803dfc46
commit 6dc8435fa1

View file

@ -142,12 +142,13 @@ public class UnidentifiedAccessHelper {
public Optional<UnidentifiedAccessPair> getAccessFor(RecipientId recipient) {
var recipientUnidentifiedAccessKey = getTargetUnidentifiedAccessKey(recipient);
if (recipientUnidentifiedAccessKey == null) {
return Optional.absent();
}
var selfUnidentifiedAccessKey = getSelfUnidentifiedAccessKey();
var selfUnidentifiedAccessCertificate = getSenderCertificateFor(recipient);
if (recipientUnidentifiedAccessKey == null
|| selfUnidentifiedAccessKey == null
|| selfUnidentifiedAccessCertificate == null) {
if (selfUnidentifiedAccessKey == null || selfUnidentifiedAccessCertificate == null) {
return Optional.absent();
}