From 6606ce69f623fcdf0337a151ad5272c03476e061 Mon Sep 17 00:00:00 2001 From: George Kalpakas Date: Wed, 25 Dec 2019 02:05:03 +0200 Subject: [PATCH] refactor(ngcc): avoid returning the same top-level helper calls multiple times (#34512) This change should not have any impact on the code's behavior (based on how the function is currently used), but it will avoid unnecessary work. PR Close #34512 --- packages/compiler-cli/ngcc/src/host/commonjs_host.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-cli/ngcc/src/host/commonjs_host.ts b/packages/compiler-cli/ngcc/src/host/commonjs_host.ts index 1818ede3d8..90ffe5d07a 100644 --- a/packages/compiler-cli/ngcc/src/host/commonjs_host.ts +++ b/packages/compiler-cli/ngcc/src/host/commonjs_host.ts @@ -95,7 +95,7 @@ export class CommonJsReflectionHost extends Esm5ReflectionHost { const helperCallsMap = getOrDefault(this.topLevelHelperCalls, helperName, () => new Map()); calls.push(...getOrDefault( helperCallsMap, sourceFile, - () => sourceFile.statements.map(statement => this.getHelperCall(statement, helperNames)) + () => sourceFile.statements.map(statement => this.getHelperCall(statement, [helperName])) .filter(isDefined))); }); return calls;