From 68035ca999cca4da80f57bb3ab42d18ae8c6815b Mon Sep 17 00:00:00 2001 From: Simon Holthausen Date: Fri, 10 May 2024 11:27:52 +0200 Subject: [PATCH] chore: deduplicate code --- .../svelte/src/internal/client/runtime.js | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/packages/svelte/src/internal/client/runtime.js b/packages/svelte/src/internal/client/runtime.js index 184bc94cc51f..a37780b6b02e 100644 --- a/packages/svelte/src/internal/client/runtime.js +++ b/packages/svelte/src/internal/client/runtime.js @@ -550,21 +550,14 @@ function process_effects(effect, filter_flags, shallow, collected_effects) { } if ((flags & RENDER_EFFECT) !== 0) { - if (is_branch) { - if (!shallow && child !== null) { - current_effect = child; - continue; - } - } else { - if (check_dirtiness(current_effect)) { - execute_effect(current_effect); - // Child might have been mutated since running the effect - child = current_effect.first; - } - if (!shallow && child !== null) { - current_effect = child; - continue; - } + if (!is_branch && check_dirtiness(current_effect)) { + execute_effect(current_effect); + // Child might have been mutated since running the effect + child = current_effect.first; + } + if (!shallow && child !== null) { + current_effect = child; + continue; } } else if ((flags & EFFECT) !== 0) { if (is_branch || is_clean) {