Skip to content

[BUG]: bodyTypeEngine discards computed adaptiveFactor — Math.min/Math.max result never assigned (dead code)#1000

Open
vipul674 wants to merge 1 commit into
Somil450:mainfrom
vipul674:fix/945-bodytypeengine-dead-code
Open

[BUG]: bodyTypeEngine discards computed adaptiveFactor — Math.min/Math.max result never assigned (dead code)#1000
vipul674 wants to merge 1 commit into
Somil450:mainfrom
vipul674:fix/945-bodytypeengine-dead-code

Conversation

@vipul674

Copy link
Copy Markdown

Description

Line 97 called Math.min(1.1, Math.max(0.9, rawFactor)) but never assigned the result to a variable. The clamped value was discarded immediately. The actual smoothedAdaptiveFactor is correctly computed from averaged ratios at line 122-123.

Fix

Removed the dead line. No behavior change — the unused computation was already a no-op.

Changes

  • src/services/bodyTypeEngine.ts: Removed unassigned Math.min/Math.max call

Closes #945

Line computed clamped value but never assigned it — result discarded.
Actual adaptiveFactor is computed from smoothed averages later so
this had no runtime effect beyond dead computation.

Closes Somil450#945
@vercel

vercel Bot commented Jun 27, 2026

Copy link
Copy Markdown

@vipul674 is attempting to deploy a commit to the somiljain2024-4175's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vipul674

Copy link
Copy Markdown
Author

@Somil450 Please review this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG]: bodyTypeEngine discards computed adaptiveFactor — Math.min/Math.max result never assigned (dead code)

1 participant