Skip to content

Commit

Permalink
[fix] optimise code
Browse files Browse the repository at this point in the history
  • Loading branch information
akshaysw committed Aug 23, 2024
1 parent 3172f85 commit 61c9945
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -591,9 +591,9 @@ private void updateParentNodesForEachEntity(AtlasLineageListContext lineageListC
for (String parentOfParent : parentsOfParentNodes) {
AtlasVertex vertex = AtlasGraphUtilsV2.findByGuid(this.graph, parentOfParent);
if (vertex != null) {
Map<String, String> details = fetchAttributes(vertex, FETCH_ENTITY_ATTRIBUTES);
// Check if the guid is already in the set
if (!seenGuids.contains(parentOfParent)) {
Map<String, String> details = fetchAttributes(vertex, FETCH_ENTITY_ATTRIBUTES);
parentNodesOfParentWithDetails.add(details);
seenGuids.add(parentOfParent); // Add the guid to the set
}
Expand Down Expand Up @@ -626,8 +626,8 @@ private void updateParentNodesForEachEntity(AtlasLineageListContext lineageListC
for (String childOfChild : childrenOfChildNode) {
AtlasVertex vertex = AtlasGraphUtilsV2.findByGuid(this.graph, childOfChild);
if (vertex != null) {
Map<String, String> details = fetchAttributes(vertex, FETCH_ENTITY_ATTRIBUTES);
if (!seenGuids.contains(childOfChild)) {
Map<String, String> details = fetchAttributes(vertex, FETCH_ENTITY_ATTRIBUTES);
childrenNodesOfChildrenWithDetails.add(details);
seenGuids.add(childOfChild); // Add the guid to the set
}
Expand Down

0 comments on commit 61c9945

Please sign in to comment.