refactor(ivy): remove forEach usage in ApplicationRef.tick (#29543)
forEach is slower as compared to a regular loop but more importantly this change removes an anonymous function and thus makes stack traces shorter and easier to read (important for perf analysis). PR Close #29543
This commit is contained in:
parent
96b800c8bc
commit
4eb6b02f08
|
@ -630,9 +630,13 @@ export class ApplicationRef {
|
||||||
const scope = ApplicationRef._tickScope();
|
const scope = ApplicationRef._tickScope();
|
||||||
try {
|
try {
|
||||||
this._runningTick = true;
|
this._runningTick = true;
|
||||||
this._views.forEach((view) => view.detectChanges());
|
for (let view of this._views) {
|
||||||
|
view.detectChanges();
|
||||||
|
}
|
||||||
if (this._enforceNoNewChanges) {
|
if (this._enforceNoNewChanges) {
|
||||||
this._views.forEach((view) => view.checkNoChanges());
|
for (let view of this._views) {
|
||||||
|
view.checkNoChanges();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
// Attention: Don't rethrow as it could cancel subscriptions to Observables!
|
// Attention: Don't rethrow as it could cancel subscriptions to Observables!
|
||||||
|
|
Loading…
Reference in New Issue