Skip to content

Commit e559254

Browse files
committed
shorter comment
1 parent 247b71a commit e559254

File tree

1 file changed

+2
-3
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+2
-3
lines changed

packages/svelte/src/internal/client/dom/blocks/each.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,8 @@ function reconcile_tracked_array(array, state, anchor, render_fn, flags, keys) {
418418
if (moved) {
419419
mark_lis(sources);
420420
} else if (is_controlled && to_destroy.length === a_items.length) {
421-
// We can optimize the case where we change all items of the each block to an entirely new set of items.
422-
// In this case we can first clear the DOM fast, along with all their effect, then we can continue
423-
// with the normal logic that appends them.
421+
// We can optimize the case in which all items are replaced —
422+
// destroy everything first, then append new items
424423
pause_effects(to_destroy, anchor);
425424
to_destroy = [];
426425
}

0 commit comments

Comments
 (0)