From 51292e27c9736a00bbb5e65d63eeb7a8c46c425d Mon Sep 17 00:00:00 2001
From: Pawel Kozlowski <pkozlowski.opensource@gmail.com>
Date: Thu, 5 Sep 2019 14:08:08 +0200
Subject: [PATCH] perf(ivy): limit TNode.outputs reads (#32495)

PR Close #32495
---
 packages/core/src/render3/instructions/listener.ts | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/packages/core/src/render3/instructions/listener.ts b/packages/core/src/render3/instructions/listener.ts
index d615413a7b..87f31ee441 100644
--- a/packages/core/src/render3/instructions/listener.ts
+++ b/packages/core/src/render3/instructions/listener.ts
@@ -182,15 +182,15 @@ function listenerInternal(
   }
 
   // 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
     // checked
-    tNode.outputs = generatePropertyAliases(tView, tNode, BindingDirection.Output);
+    outputs = tNode.outputs = generatePropertyAliases(tView, tNode, BindingDirection.Output);
   }
 
-  const outputs = tNode.outputs;
   let props: PropertyAliasValue|undefined;
-  if (processOutputs && outputs && (props = outputs[eventName])) {
+  if (processOutputs && outputs !== null && (props = outputs[eventName])) {
     const propsLength = props.length;
     if (propsLength) {
       const lCleanup = getCleanup(lView);