Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: deduplicate cycles in graph #77

Closed

Conversation

admons
Copy link
Contributor

@admons admons commented Dec 14, 2020

  • Ready for review
  • Follows CONTRIBUTING rules
  • Reviewed by Snyk internal team

What does this PR do?

new mapToNonCyclicGraph function that takes a cyclic depgraph and returns a new instance of a depGraph with the cycles pruned.

@admons admons requested a review from a team as a code owner December 14, 2020 14:34
depGraph.rootNodeId
);

const eventLoopSpinner = new EventLoopSpinner();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can move to module scope - there's no value in passing a locally scoped instance around

};
dependencies = [];
} else if (memoizationSet.has(nodeId)) {
dependencies = [];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm.. this is a very obscure way to skip the iteration on line 65. It took a while for me to understand why you'd be setting this to an empty list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants