Skip to content

Commit

Permalink
perf: remove the extra else in propagate (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
medz authored Dec 23, 2024
1 parent 18c7051 commit acf19b6
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,9 @@ export function propagate(subs: Link): void {
const subFlags = sub.flags;

if (!(subFlags & SubscriberFlags.Tracking)) {
sub.flags = subFlags | targetFlag;
if (
(
!(subFlags >> 2)
&& (sub.flags = subFlags | targetFlag, true)
)
!(subFlags >> 2)
|| (
subFlags & SubscriberFlags.Recursed
&& (sub.flags = (subFlags & ~SubscriberFlags.Recursed) | targetFlag, true)
Expand Down Expand Up @@ -165,12 +163,11 @@ export function propagate(subs: Link): void {
}
queuedEffectsTail = sub;
}
} else {
sub.flags = subFlags | targetFlag;
}
} else if (isValidLink(link, sub)) {
sub.flags = targetFlag = subFlags | targetFlag;
if (!(subFlags >> 2)) {
sub.flags = subFlags | targetFlag | SubscriberFlags.Recursed;
sub.flags = targetFlag | SubscriberFlags.Recursed;
const subSubs = (sub as Dependency).subs;
if (subSubs !== undefined) {
if (subSubs.nextSub !== undefined) {
Expand All @@ -186,8 +183,6 @@ export function propagate(subs: Link): void {
}
continue;
}
} else if (!(subFlags & targetFlag)) {
sub.flags = subFlags | targetFlag;
}
}

Expand Down

0 comments on commit acf19b6

Please sign in to comment.