mirror of
https://github.com/ezolenko/rollup-plugin-typescript2.git
synced 2025-12-08 19:06:16 +00:00
refactor(cache): further condense walkTree (#393)
- `forEach` returns `void`, so we can just `return` it and condense the `if` a bit
This commit is contained in:
parent
ad29112a5f
commit
bbed47e16a
@ -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));
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user