From dcca80bb1ef3003bf6b6eacd221ce9d64e2445cd Mon Sep 17 00:00:00 2001 From: Pawel Kozlowski Date: Fri, 11 Oct 2019 14:42:12 +0200 Subject: [PATCH] perf(ivy): limit memory reads in getOrCreateNodeInjectorForNode (#33102) PR Close #33102 --- packages/core/src/render3/di.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/core/src/render3/di.ts b/packages/core/src/render3/di.ts index 3cdbc6c6d4..a860087aeb 100644 --- a/packages/core/src/render3/di.ts +++ b/packages/core/src/render3/di.ts @@ -155,14 +155,13 @@ export function getOrCreateNodeInjectorForNode( } const parentLoc = getParentInjectorLocation(tNode, hostView); - const parentIndex = getParentInjectorIndex(parentLoc); - const parentLView = getParentInjectorView(parentLoc, hostView); - const injectorIndex = tNode.injectorIndex; // If a parent injector can't be found, its location is set to -1. // In that case, we don't need to set up a cumulative bloom if (hasParentInjector(parentLoc)) { + const parentIndex = getParentInjectorIndex(parentLoc); + const parentLView = getParentInjectorView(parentLoc, hostView); const parentData = parentLView[TVIEW].data as any; // Creates a cumulative bloom filter that merges the parent's bloom filter // and its own cumulative bloom (which contains tokens for all ancestors)