Skip to content

Commit

Permalink
refactor: improve logical symmetry in propagate function
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Jan 8, 2025
1 parent f067856 commit 0e162a9
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,12 @@ export function propagate(link: Link): void {
sub.flags = subFlags | targetFlag;
}

if ((link = subs.nextSub!) === undefined) {
if ((link = subs.nextSub!) !== undefined) {
subs = link;
targetFlag = stack
? SubscriberFlags.ToCheckDirty
: SubscriberFlags.Dirty;
} else {
while (stack) {
--stack;
const dep = subs.dep;
Expand All @@ -197,10 +202,6 @@ export function propagate(link: Link): void {
}
break;
}
subs = link;
targetFlag = stack
? SubscriberFlags.ToCheckDirty
: SubscriberFlags.Dirty;
} while (true);

if (!batchDepth) {
Expand Down

0 comments on commit 0e162a9

Please sign in to comment.