Commit 672d2a2
committed
perf(syntax): avoid array spread in PathExpression.original getter
The getter on `PathExpression` in `legacy-interop.ts` is read once or
more per path node visit by every Ember template plugin. Its previous
form allocated a fresh array on every call:
return [this.head.original, ...this.tail].join('.');
Replace with a direct head return for the empty-tail case and a string
concat for the rest:
const head = this.head.original;
return this.tail.length === 0 ? head : head + '.' + this.tail.join('.');
No behaviour change — both forms return the same string for every
(head, tail). See PR description for the equivalence proof and the
before/after measurements.1 parent 0d73c63 commit 672d2a2
1 file changed
Lines changed: 2 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
| 52 | + | |
52 | 53 | | |
53 | 54 | | |
54 | 55 | | |
| |||
0 commit comments