Skip to content

Commit

Permalink
minor optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ksrinath committed Jul 22, 2024
1 parent b8759e2 commit 69a1222
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,12 @@ private EntityRelationshipsResult mapEntityRelationships(
final boolean includeSoftDelete) {
final EntityRelationshipsResult result = new EntityRelationshipsResult();

Set<Urn> allRelatedUrns =
entityRelationships.getRelationships().stream()
.map(EntityRelationship::getEntity)
.collect(Collectors.toSet());

final Set<Urn> existentUrns;
if (context != null && _entityService != null && !includeSoftDelete) {
Set<Urn> allRelatedUrns =
entityRelationships.getRelationships().stream()
.map(EntityRelationship::getEntity)
.collect(Collectors.toSet());
existentUrns = _entityService.exists(context.getOperationContext(), allRelatedUrns, false);
} else {
existentUrns = null;
Expand Down

0 comments on commit 69a1222

Please sign in to comment.