perf(ivy): clean up findComponentView for speed (#30453)

PR Close #30453
This commit is contained in:
Misko Hevery 2019-05-14 21:46:13 -07:00 committed by Jason Aden
parent 9ce9561737
commit e122b44269
1 changed files with 1 additions and 1 deletions

View File

@ -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];