Skip to content

Commit

Permalink
fix: inefficient removeDuplicateImplied
Browse files Browse the repository at this point in the history
  • Loading branch information
SkepticMystic committed Jul 15, 2021
1 parent 10b64d4 commit 3d2b88e
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions src/MatrixView.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,9 @@ export default class MatrixView extends ItemView {
reals: internalLinkObj[],
implieds: internalLinkObj[]
): internalLinkObj[] {
// const noDuplicatesImplieds = implieds;
// reals.forEach(real => {
// implieds.forEach((implied, i) => {
// if (implied.to === real.to) {
// noDuplicatesImplieds.slice(i, 1)
// }
// })
// });

const noDuplicates = implieds.filter(implied => !reals.map(real => real.to).includes(implied.to))
return noDuplicates

const realTos = reals.map(real => real.to);
return implieds.filter(implied => !realTos.includes(implied.to))
}

dfsAllPaths(g: Graph, startNode: string): string[][] {
Expand Down

0 comments on commit 3d2b88e

Please sign in to comment.