perf(ivy): limit global state read / write in host bindings (#33195)

PR Close #33195
This commit is contained in:
Pawel Kozlowski 2019-10-16 13:52:58 +02:00 committed by Matias Niemelä
parent aef7dca234
commit 3e14c2d02c
1 changed files with 1 additions and 3 deletions

View File

@ -539,7 +539,6 @@ export function createDirectivesInstances(
if ((tNode.flags & TNodeFlags.hasHostBindings) === TNodeFlags.hasHostBindings) { if ((tNode.flags & TNodeFlags.hasHostBindings) === TNodeFlags.hasHostBindings) {
invokeDirectivesHostBindings(tView, lView, tNode); invokeDirectivesHostBindings(tView, lView, tNode);
} }
setActiveHostElement(null);
} }
/** /**
@ -1118,7 +1117,6 @@ function invokeDirectivesHostBindings(tView: TView, viewData: LView, tNode: TNod
const expando = tView.expandoInstructions !; const expando = tView.expandoInstructions !;
const firstTemplatePass = tView.firstTemplatePass; const firstTemplatePass = tView.firstTemplatePass;
const elementIndex = tNode.index - HEADER_OFFSET; const elementIndex = tNode.index - HEADER_OFFSET;
const selectedIndex = getSelectedIndex();
try { try {
setActiveHostElement(elementIndex); setActiveHostElement(elementIndex);
@ -1135,7 +1133,7 @@ function invokeDirectivesHostBindings(tView: TView, viewData: LView, tNode: TNod
} }
} }
} finally { } finally {
setActiveHostElement(selectedIndex); setActiveHostElement(null);
} }
} }