From 052b01ffba07547993c3db3fdc220d0f693c5fc5 Mon Sep 17 00:00:00 2001 From: Anton Gilgur Date: Sat, 11 Jun 2022 22:01:43 -0400 Subject: [PATCH] refactor(cache): tiny simplification to `walkTree` - 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 c4195a56..9dca957e 100644 --- a/src/tscache.ts +++ b/src/tscache.ts @@ -177,9 +177,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;