Skip to content

Commit

Permalink
perf(ivy): limit global state read / write in host bindings (angular#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pkozlowski-opensource authored and matsko committed Oct 16, 2019
1 parent aef7dca commit 3e14c2d
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions packages/core/src/render3/instructions/shared.ts
Expand Up @@ -539,7 +539,6 @@ export function createDirectivesInstances(
if ((tNode.flags & TNodeFlags.hasHostBindings) === TNodeFlags.hasHostBindings) {
invokeDirectivesHostBindings(tView, lView, tNode);
}
setActiveHostElement(null);
}

/**
Expand Down Expand Up @@ -1118,7 +1117,6 @@ function invokeDirectivesHostBindings(tView: TView, viewData: LView, tNode: TNod
const expando = tView.expandoInstructions !;
const firstTemplatePass = tView.firstTemplatePass;
const elementIndex = tNode.index - HEADER_OFFSET;
const selectedIndex = getSelectedIndex();
try {
setActiveHostElement(elementIndex);

Expand All @@ -1135,7 +1133,7 @@ function invokeDirectivesHostBindings(tView: TView, viewData: LView, tNode: TNod
}
}
} finally {
setActiveHostElement(selectedIndex);
setActiveHostElement(null);
}
}

Expand Down

0 comments on commit 3e14c2d

Please sign in to comment.