perf(ivy): only refresh child components if those are defined in a given view (#31839)

PR Close #31839
This commit is contained in:
Pawel Kozlowski 2019-07-25 10:44:41 +02:00 committed by Andrew Kushnir
parent e08391b333
commit 430124a051
1 changed files with 7 additions and 6 deletions

View File

@ -107,7 +107,10 @@ export function refreshDescendantViews(lView: LView) {
executeViewQueryFn(RenderFlags.Update, tView, lView[CONTEXT]);
}
refreshChildComponents(lView, tView.components);
const components = tView.components;
if (components !== null) {
refreshChildComponents(lView, components);
}
}
@ -183,13 +186,11 @@ function refreshContentQueries(tView: TView, lView: LView): void {
}
/** Refreshes child components in the current view. */
function refreshChildComponents(hostLView: LView, components: number[] | null): void {
if (components != null) {
function refreshChildComponents(hostLView: LView, components: number[]): void {
for (let i = 0; i < components.length; i++) {
componentRefresh(hostLView, components[i]);
}
}
}
/**