Skip to content

refactor: drop unreachable arm64 branch in LinuxBuilder.getFileName#1291

Open
LuisMIguelFurlanettoSousa wants to merge 1 commit into
tw93:mainfrom
LuisMIguelFurlanettoSousa:refactor/linuxbuilder-dead-arch-branch
Open

refactor: drop unreachable arm64 branch in LinuxBuilder.getFileName#1291
LuisMIguelFurlanettoSousa wants to merge 1 commit into
tw93:mainfrom
LuisMIguelFurlanettoSousa:refactor/linuxbuilder-dead-arch-branch

Conversation

@LuisMIguelFurlanettoSousa

Copy link
Copy Markdown

Closes #1290

What

The inner if (this.buildArch === 'arm64' && ...) in getFileName() sits inside the else of if (this.buildArch === 'arm64'), so this.buildArch is provably never 'arm64' there — the branch and its aarch64 assignment are unreachable. The arm64 → aarch64 mapping is already handled by the first branch.

Change

Remove the dead branch and flatten the nested else { if } into an else if chain. dist/cli.js rebuilt.

Verify

Behavior-preserving; full suite passes:

npx vitest run

205 passed; pnpm run format:check clean.

In getFileName the inner check 'if (this.buildArch === "arm64" && ...)' sat
inside the else of 'if (this.buildArch === "arm64")', so this.buildArch is
provably never 'arm64' at that point and the branch (and its 'aarch64'
assignment) can never run. Remove it and flatten the nested else into an
else-if chain; the arm64 -> aarch64 mapping is already handled by the first
branch, so behavior is unchanged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant