Skip to content

Commit

Permalink
refactor(core): Use Nullish coalescing assignment for view getters. (a…
Browse files Browse the repository at this point in the history
…ngular#56242)

Micro optim, this wasn't minified by the optimizer.

PR Close angular#56242
  • Loading branch information
JeanMeche authored and thePunderWoman committed Jun 3, 2024
1 parent 3d2f963 commit 73e84e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/render3/instructions/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1956,11 +1956,11 @@ export function storePropertyBindingMetadata(

export function getOrCreateLViewCleanup(view: LView): any[] {
// top level variables should not be exported for performance reasons (PERF_NOTES.md)
return view[CLEANUP] || (view[CLEANUP] = []);
return (view[CLEANUP] ??= []);
}

export function getOrCreateTViewCleanup(tView: TView): any[] {
return tView.cleanup || (tView.cleanup = []);
return (tView.cleanup ??= []);
}

/**
Expand Down

0 comments on commit 73e84e2

Please sign in to comment.