fix: avoid extra work in mark_reactions (#12921)

* fix: avoid extra work in mark_reactions

* Update packages/svelte/src/internal/client/reactivity/sources.js

Co-authored-by: Rich Harris <rich.harris@vercel.com>

---------

Co-authored-by: Rich Harris <rich.harris@vercel.com>
pull/12931/head
Dominic Gannaway 4 months ago committed by GitHub
parent a8c6b92f9a
commit 4ce23bf07e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,5 @@
---
'svelte': patch
---
fix: avoid extra work in mark_reactions

@ -145,8 +145,8 @@ function mark_reactions(signal, status) {
var reaction = reactions[i]; var reaction = reactions[i];
var flags = reaction.f; var flags = reaction.f;
// Skip any effects that are already dirty // If a reaction is already dirty, skip it (but always mark unowned deriveds)
if ((flags & DIRTY) !== 0) continue; if ((flags & (CLEAN | UNOWNED)) === 0) continue;
// In legacy mode, skip the current effect to prevent infinite loops // In legacy mode, skip the current effect to prevent infinite loops
if (!runes && reaction === current_effect) continue; if (!runes && reaction === current_effect) continue;

Loading…
Cancel
Save