Skip to content

Commit

Permalink
Simplify unnecessary flatMap in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
emlun committed Oct 21, 2021
1 parent 3891ecf commit 3f6d846
Showing 1 changed file with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,14 @@ public Optional<RegisteredCredential> lookup(ByteArray credentialId, ByteArray u
credentialId,
userHandle,
registrationMaybe);
return registrationMaybe.flatMap(
return registrationMaybe.map(
registration ->
Optional.of(
RegisteredCredential.builder()
.credentialId(registration.getCredential().getCredentialId())
.userHandle(registration.getUserIdentity().getId())
.publicKeyCose(registration.getCredential().getPublicKeyCose())
.signatureCount(registration.getCredential().getSignatureCount())
.build()));
RegisteredCredential.builder()
.credentialId(registration.getCredential().getCredentialId())
.userHandle(registration.getUserIdentity().getId())
.publicKeyCose(registration.getCredential().getPublicKeyCose())
.signatureCount(registration.getCredential().getSignatureCount())
.build());
}

@Override
Expand Down

0 comments on commit 3f6d846

Please sign in to comment.