Skip to content

Commit bbed47e

Browse files
authored
refactor(cache): further condense walkTree (#393)
- `forEach` returns `void`, so we can just `return` it and condense the `if` a bit
1 parent ad29112 commit bbed47e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/tscache.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,9 @@ export class TsCache
188188
public walkTree(cb: (id: string) => void | false): void
189189
{
190190
if (alg.isAcyclic(this.dependencyTree))
191-
{
192-
alg.topsort(this.dependencyTree).forEach(id => cb(id));
193-
return;
194-
}
191+
return alg.topsort(this.dependencyTree).forEach(id => cb(id));
195192

196193
this.context.info(yellow("import tree has cycles"));
197-
198194
this.dependencyTree.nodes().forEach(id => cb(id));
199195
}
200196

0 commit comments

Comments
 (0)