perf: skip re-splitting unchanged text tokens (#26326)

This commit is contained in:
Algorithm5838 authored and GitHub committed 2026-06-28 22:09:58 -05:00
1 parent ea3f5f22d2
commit 6729e64f30
1 file changed
+4 -2
@@ -1,12 +1,14 @@
<script lang="ts"> <script lang="ts">
export let token; export let token;
export let done = true; export let done = true;
$: raw = token?.raw ?? '';
</script> </script>
{#if done} {#if done}
{token?.raw} {raw}
{:else} {:else}
{#each (token?.raw ?? '').split(' ') as text} {#each raw.split(' ') as text}
<span class="fade-in-token"> <span class="fade-in-token">
{text}{' '} {text}{' '}
</span> </span>