mirror of
https://github.com/heygen-com/hyperframes.git
synced 2026-09-12 15:20:13 +00:00
fix(cli): simplify nextInstallState's dead hadFired branch (review nit)
Both reviewers (Rames, Magi) independently flagged the same thing: by the time the return statement executes, hadFired is always false — the guard above already returns early for every case where hadFired was true. The merge expression wantFired || hadFired || undefined was defensively correct but misleading; it reads as "OR the two together" when the function has already established only one of them can be true here. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
dfe92b2aab
commit
ec76985f40
@@ -92,9 +92,13 @@ function writeInstallState(next: InstallState): void {
|
|||||||
function nextInstallState(state: InstallState | null, wantFired: boolean): InstallState | null {
|
function nextInstallState(state: InstallState | null, wantFired: boolean): InstallState | null {
|
||||||
const hadFired = state?.deParallelRouterTrialFired === true;
|
const hadFired = state?.deParallelRouterTrialFired === true;
|
||||||
if (state !== null && (hadFired || !wantFired)) return null;
|
if (state !== null && (hadFired || !wantFired)) return null;
|
||||||
|
// Every path reaching here has hadFired === false (state is either null, or
|
||||||
|
// the guard above already returned when hadFired was true) — the field is
|
||||||
|
// simply wantFired, not a merge of the two (review nit, two independent
|
||||||
|
// reviewers).
|
||||||
return {
|
return {
|
||||||
markerAt: state?.markerAt ?? new Date().toISOString(),
|
markerAt: state?.markerAt ?? new Date().toISOString(),
|
||||||
deParallelRouterTrialFired: wantFired || hadFired || undefined,
|
deParallelRouterTrialFired: wantFired || undefined,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user