Skip to content

Commit

Permalink
refactor(cache): further condense walkTree (#393)
Browse files Browse the repository at this point in the history
- `forEach` returns `void`, so we can just `return` it and condense the `if` a bit
  • Loading branch information
agilgur5 authored Aug 8, 2022
1 parent ad29112 commit bbed47e
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/tscache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -188,13 +188,9 @@ export class TsCache
public walkTree(cb: (id: string) => void | false): void
{
if (alg.isAcyclic(this.dependencyTree))
{
alg.topsort(this.dependencyTree).forEach(id => cb(id));
return;
}
return alg.topsort(this.dependencyTree).forEach(id => cb(id));

this.context.info(yellow("import tree has cycles"));

this.dependencyTree.nodes().forEach(id => cb(id));
}

Expand Down

0 comments on commit bbed47e

Please sign in to comment.