From 145a5cc20491adf1f9e635caccf32c294f28aa00 Mon Sep 17 00:00:00 2001 From: Rich Harris Date: Thu, 28 May 2026 07:50:08 -0400 Subject: [PATCH] shrink comment (the AI agent habit of referring to the behaviour of the code it just deleted is somewhat unhelpful) --- packages/svelte/src/internal/client/dom/blocks/each.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/svelte/src/internal/client/dom/blocks/each.js b/packages/svelte/src/internal/client/dom/blocks/each.js index 1a3e67c8df..646a85b54f 100644 --- a/packages/svelte/src/internal/client/dom/blocks/each.js +++ b/packages/svelte/src/internal/client/dom/blocks/each.js @@ -628,11 +628,7 @@ function reconcile(state, array, anchor, flags, get_key) { var controlled_anchor = (flags & EACH_IS_CONTROLLED) !== 0 && length === 0 ? anchor : null; if (is_animated) { - // Three batched phases minimise layout flushes. With the per-item - // `fix()` body each iteration forced two reflows (one for the - // `getComputedStyle` read, one for the post-absolute - // `getBoundingClientRect` read); batching brings the whole batch - // down to ~2 flushes total. + // Doing all the reads _then_ all the writes minimises layout flushes for (i = 0; i < destroy_length; i += 1) to_destroy[i].nodes?.a?.measure(); for (i = 0; i < destroy_length; i += 1) to_destroy[i].nodes?.a?.capture_size(); for (i = 0; i < destroy_length; i += 1) to_destroy[i].nodes?.a?.set_position();