mirror of https://github.com/sveltejs/svelte
perf: emit `$.only_child` for elements with a single child (#18717)
`<p>{text}</p>` and friends compile to `var x = $.child(p, true);
$.reset(p);`. Across the 4,020 components in `packages/svelte/tests`,
that exact pair occurs 1,885 times, more than any other adjacent
statement pair.
`$.only_child` does both, reducing the number of statements in the compiled output
pull/18712/head
parent
6b99f9fb52
commit
34489c10df
@ -0,0 +1,5 @@
|
||||
---
|
||||
'svelte': patch
|
||||
---
|
||||
|
||||
perf: emit `$.only_child` for elements with a single child
|
||||
Loading…
Reference in new issue