Skip to content

Commit 27d7ebd

Browse files
committed
perf(size): fold the trailing hold guard into one expression
Same truth table as the if: a non-effect holds, an effect holds unless freshHook answers CAUGHT_REARMED; freshHook is still read once. About -1 B minified on the boundary rows. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_015hPxMkC3jg3Uivh65gvaf2
1 parent 289ef7f commit 27d7ebd

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/signals/src/core/core.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ export function recompute(el: Computed<any>, create: boolean = false): void {
983983
// through such a reader (`blockedBy`, #4542).
984984
if (create && lane === null && joined && el._statusFlags & STATUS_PENDING) {
985985
const t = flushTransaction ?? passTx;
986-
if (t && !t._lane && (!isEffect || freshHook?.(el) !== CAUGHT_REARMED)) holdNode(el, t);
986+
t && !t._lane && ((isEffect && freshHook?.(el) === CAUGHT_REARMED) || holdNode(el, t));
987987
}
988988
// Dependencies are the committed frame's until it is replaced (A30, #3410):
989989
// a pass that staged its value leaves the previous pass's tail linked for

0 commit comments

Comments
 (0)