reduce nesting

pull/17004/head
Rich Harris 1 week ago
parent 1d58137a3b
commit 3a27726b86

@ -759,16 +759,16 @@ function mark_effects(value, sources, marked, checked) {
* @param {Set<Effect>} effects * @param {Set<Effect>} effects
*/ */
function mark_eager_effects(value, effects) { function mark_eager_effects(value, effects) {
if (value.reactions !== null) { if (value.reactions === null) return;
for (const reaction of value.reactions) {
const flags = reaction.f;
if ((flags & DERIVED) !== 0) { for (const reaction of value.reactions) {
mark_eager_effects(/** @type {Derived} */ (reaction), effects); const flags = reaction.f;
} else if ((flags & EAGER_EFFECT) !== 0) {
set_signal_status(reaction, DIRTY); if ((flags & DERIVED) !== 0) {
effects.add(/** @type {Effect} */ (reaction)); mark_eager_effects(/** @type {Derived} */ (reaction), effects);
} } else if ((flags & EAGER_EFFECT) !== 0) {
set_signal_status(reaction, DIRTY);
effects.add(/** @type {Effect} */ (reaction));
} }
} }
} }

Loading…
Cancel
Save