@@ -22,8 +22,7 @@ import {
22
22
BLOCK_EFFECT ,
23
23
ROOT_EFFECT ,
24
24
LEGACY_DERIVED_PROP ,
25
- DISCONNECTED ,
26
- EFFECT_QUEUED
25
+ DISCONNECTED
27
26
} from './constants.js' ;
28
27
import { flush_tasks } from './dom/task.js' ;
29
28
import { add_owner } from './dev/ownership.js' ;
@@ -512,8 +511,8 @@ function flush_queued_root_effects(root_effects) {
512
511
for ( var i = 0 ; i < length ; i ++ ) {
513
512
var effect = root_effects [ i ] ;
514
513
515
- if ( ( effect . f & EFFECT_QUEUED ) ! == 0 ) {
516
- effect . f ^= EFFECT_QUEUED ;
514
+ if ( ( effect . f & CLEAN ) = == 0 ) {
515
+ effect . f ^= CLEAN ;
517
516
}
518
517
519
518
/** @type {Effect[] } */
@@ -593,15 +592,10 @@ export function schedule_effect(signal) {
593
592
effect = effect . parent ;
594
593
var flags = effect . f ;
595
594
596
- if ( ( flags & BRANCH_EFFECT ) !== 0 ) {
595
+ if ( ( flags & ( ROOT_EFFECT | BRANCH_EFFECT ) ) !== 0 ) {
597
596
if ( ( flags & CLEAN ) === 0 ) return ;
598
597
effect . f ^= CLEAN ;
599
598
}
600
-
601
- if ( ( flags & ROOT_EFFECT ) !== 0 ) {
602
- if ( ( flags & EFFECT_QUEUED ) !== 0 ) return ;
603
- effect . f ^= EFFECT_QUEUED ;
604
- }
605
599
}
606
600
607
601
queued_root_effects . push ( effect ) ;
@@ -624,23 +618,18 @@ function process_effects(effect, collected_effects) {
624
618
625
619
main_loop: while ( current_effect !== null ) {
626
620
var flags = current_effect . f ;
627
- var is_active = ( flags & INERT ) === 0 ;
628
621
var is_branch = ( flags & BRANCH_EFFECT ) !== 0 ;
629
- var is_clean = ( flags & CLEAN ) !== 0 ;
630
- var child = current_effect . first ;
631
-
632
- // Skip this branch if it's clean
633
- if ( is_active && ( ! is_branch || ! is_clean ) ) {
634
- if ( is_branch ) {
635
- set_signal_status ( current_effect , CLEAN ) ;
636
- }
622
+ var is_skippable_branch = is_branch && ( flags & CLEAN ) !== 0 ;
637
623
624
+ if ( ! is_skippable_branch && ( flags & INERT ) === 0 ) {
638
625
if ( ( flags & RENDER_EFFECT ) !== 0 ) {
639
- if ( ! is_branch && check_dirtiness ( current_effect ) ) {
626
+ if ( is_branch ) {
627
+ current_effect . f ^= CLEAN ;
628
+ } else if ( check_dirtiness ( current_effect ) ) {
640
629
update_effect ( current_effect ) ;
641
630
}
642
- // Child might have been mutated since running the effect or checking dirtiness
643
- child = current_effect . first ;
631
+
632
+ var child = current_effect . first ;
644
633
645
634
if ( child !== null ) {
646
635
current_effect = child ;
0 commit comments