fix: Correct typo and remove unused variables in#1958
Conversation
There was a problem hiding this comment.
Pull request overview
This PR fixes a typo (quantStonts to quantStones) and adjusts variable scope in the contract duration estimation logic. The typo corrections ensure consistency in variable naming throughout the code. The variable scope changes move tachStones and quantStones declarations from the outer loop scope into the conditional block where they are actually used (when slots == 10.0).
Key changes:
- Fixed typo:
quantStonts→quantStonesin two locations - Moved
tachStonesandquantStonesvariable declarations to narrower scope within theslots == 10.0conditional block - Changed third return value assignment from
getContractDurationEstimateto use blank identifier
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/boost/estimate_time.go | Fixed typo in variable name and moved variable declarations to appropriate scope within the slots==10.0 conditional |
| src/boost/boost_import.go | Replaced EstimatedDurationMax assignment with blank identifier for the third return value |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| c.Grade[grade].LengthInSeconds = c.LengthInSeconds | ||
|
|
||
| c.Grade[grade].EstimatedDuration, c.Grade[grade].EstimatedDurationLower, c.Grade[grade].EstimatedDurationMax = getContractDurationEstimate(c.TargetAmount[len(c.TargetAmount)-1], float64(c.MaxCoopSize), c.LengthInSeconds, | ||
| c.Grade[grade].EstimatedDuration, c.Grade[grade].EstimatedDurationLower, _ = getContractDurationEstimate(c.TargetAmount[len(c.TargetAmount)-1], float64(c.MaxCoopSize), c.LengthInSeconds, |
There was a problem hiding this comment.
The third return value from getContractDurationEstimate (EstimatedDurationMax) is being discarded, but this value is still used elsewhere in the codebase. Specifically, it's used on line 283 of this file for calculating durationMod and on line 426 of src/boost/replay.go for displaying estimated duration. This will cause the EstimatedDurationMax field to remain uninitialized (zero value) for grade-specific estimates, which could lead to incorrect calculations or display issues.
| c.Grade[grade].EstimatedDuration, c.Grade[grade].EstimatedDurationLower, _ = getContractDurationEstimate(c.TargetAmount[len(c.TargetAmount)-1], float64(c.MaxCoopSize), c.LengthInSeconds, | |
| c.Grade[grade].EstimatedDuration, c.Grade[grade].EstimatedDurationLower, c.Grade[grade].EstimatedDurationMax = getContractDurationEstimate(c.TargetAmount[len(c.TargetAmount)-1], float64(c.MaxCoopSize), c.LengthInSeconds, |
No description provided.