Skip to content

Commit c0b5894

Browse files
committed
simplify
1 parent 5b8520b commit c0b5894

File tree

1 file changed

+1
-5
lines changed
  • packages/svelte/src/internal/client/dom/blocks

1 file changed

+1
-5
lines changed

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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -149,13 +149,9 @@ export function each(anchor, flags, get_collection, get_key, render_fn, fallback
149149
let mismatch = false;
150150

151151
if (hydrating) {
152-
// if the server has 0 elements it will either render an else or have 0 hydrate_nodes
153152
var is_else = /** @type {Comment} */ (anchor).data === HYDRATION_END_ELSE;
154-
var empty_hydrate_nodes = hydrate_nodes.length === 0;
155153

156-
// so if is an else or has 0 hydrate_nodes and the it's false that lenght is 0 we remove
157-
// hydrate_nodes and set hydrating to false
158-
if ((is_else || empty_hydrate_nodes) !== (length === 0)) {
154+
if (is_else !== (length === 0) || hydrate_start === undefined) {
159155
// hydration mismatch — remove the server-rendered DOM and start over
160156
remove(hydrate_nodes);
161157
set_hydrating(false);

0 commit comments

Comments
 (0)