chore: simplify is_dirty (#17444)

* chore: simplify is_dirty

* tidy up
pull/17445/head
Rich Harris 9 months ago committed by GitHub
parent 359be81c09
commit f8bdadc1bf
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -328,7 +328,7 @@ export function legacy_pre_effect_reset() {
// If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through // If the effect is CLEAN, then make it MAYBE_DIRTY. This ensures we traverse through
// the effects dependencies and correctly ensure each dependency is up-to-date. // the effects dependencies and correctly ensure each dependency is up-to-date.
if ((effect.f & CLEAN) !== 0) { if ((effect.f & CLEAN) !== 0 && effect.deps !== null) {
set_signal_status(effect, MAYBE_DIRTY); set_signal_status(effect, MAYBE_DIRTY);
} }

@ -166,9 +166,7 @@ export function is_dirty(reaction) {
} }
if ((flags & MAYBE_DIRTY) !== 0) { if ((flags & MAYBE_DIRTY) !== 0) {
var dependencies = reaction.deps; var dependencies = /** @type {Value[]} */ (reaction.deps);
if (dependencies !== null) {
var length = dependencies.length; var length = dependencies.length;
for (var i = 0; i < length; i++) { for (var i = 0; i < length; i++) {
@ -182,7 +180,6 @@ export function is_dirty(reaction) {
return true; return true;
} }
} }
}
if ( if (
(flags & CONNECTED) !== 0 && (flags & CONNECTED) !== 0 &&

Loading…
Cancel
Save