From 42c94b8c9d0ef120ef94ffe354144f1c3d2a44dd Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Tue, 14 Jun 2022 12:03:57 -0400 Subject: [PATCH] refactor(cache): tiny simplification to `walkTree` (#359) - the `acyclic` var is literally only used in one place, directly below its instantiation - so don't use a var at all instead for simplicity --- src/tscache.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/tscache.ts b/src/tscache.ts index e3582b7..85e4852 100644 --- a/src/tscache.ts +++ b/src/tscache.ts @@ -178,9 +178,7 @@ export class TsCache public walkTree(cb: (id: string) => void | false): void { - const acyclic = alg.isAcyclic(this.dependencyTree); - - if (acyclic) + if (alg.isAcyclic(this.dependencyTree)) { alg.topsort(this.dependencyTree).forEach(id => cb(id)); return;