perf(ivy): limit TNode.outputs reads (#32495)

PR Close #32495
This commit is contained in:
Pawel Kozlowski 2019-09-05 14:08:08 +02:00 committed by Kara Erickson
parent 6674746e86
commit 51292e27c9
1 changed files with 4 additions and 4 deletions

View File

@ -182,15 +182,15 @@ function listenerInternal(
} }
// subscribe to directive outputs // subscribe to directive outputs
if (tNode.outputs === undefined) { let outputs = tNode.outputs;
if (outputs === undefined) {
// if we create TNode here, inputs must be undefined so we know they still need to be // if we create TNode here, inputs must be undefined so we know they still need to be
// checked // checked
tNode.outputs = generatePropertyAliases(tView, tNode, BindingDirection.Output); outputs = tNode.outputs = generatePropertyAliases(tView, tNode, BindingDirection.Output);
} }
const outputs = tNode.outputs;
let props: PropertyAliasValue|undefined; let props: PropertyAliasValue|undefined;
if (processOutputs && outputs && (props = outputs[eventName])) { if (processOutputs && outputs !== null && (props = outputs[eventName])) {
const propsLength = props.length; const propsLength = props.length;
if (propsLength) { if (propsLength) {
const lCleanup = getCleanup(lView); const lCleanup = getCleanup(lView);