From e122b44269334bbca1a3dd3daae1333810632421 Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Tue, 14 May 2019 21:46:13 -0700 Subject: [PATCH] perf(ivy): clean up findComponentView for speed (#30453) PR Close #30453 --- packages/core/src/render3/util/view_traversal_utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/core/src/render3/util/view_traversal_utils.ts b/packages/core/src/render3/util/view_traversal_utils.ts index dc672ec83e..7677edf333 100644 --- a/packages/core/src/render3/util/view_traversal_utils.ts +++ b/packages/core/src/render3/util/view_traversal_utils.ts @@ -49,7 +49,7 @@ export function getRootView(componentOrLView: LView | {}): LView { */ export function findComponentView(lView: LView): LView { let rootTNode = lView[T_HOST]; - while (rootTNode && rootTNode.type === TNodeType.View) { + while (rootTNode !== null && rootTNode.type === TNodeType.View) { ngDevMode && assertDefined(lView[DECLARATION_VIEW], 'lView[DECLARATION_VIEW]'); lView = lView[DECLARATION_VIEW] !; rootTNode = lView[T_HOST];