Conversation
…into cppCheck_redundantAssignment
…into cppCheck_redundantAssignment
| } else { | ||
| S1PLR = 0.0; | ||
| } | ||
|
|
There was a problem hiding this comment.
S1PLR gets set right after the stage-1 full-load calc, but that value is never used before S1PLR is recomputed in the “Determine run-time fractions” block, line 545 - 550 (develop). We can just drop the first S1PLR = PartLoadRatio or 0.0 assignment (no behavior change, since it was overwritten before use).
|
|
||
| // Stage 1 | ||
| } else if (CycRatio > 0.0 || (CycRatio > 0.0 && SingleMode == 1)) { | ||
| } else if (CycRatio > 0.0 || (CycRatio > 0.0 && SingleMode == 1)) { // cppCheck Redundant Condition flag |
There was a problem hiding this comment.
If the intent was to include SingleMode in the logic, this might need to be CycRatio > 0.0 || SingleMode == 1 or CycRatio > 0.0 && SingleMode == 1; otherwise it can be simplified to CycRatio > 0.0.
| lineIn = statFile.readLine(); | ||
| } | ||
| lineIn = statFile.readLine(); | ||
| lineAvg = lineIn.data; |
There was a problem hiding this comment.
The last lineIn = readLine() inside the 7-line skip loop is immediately overwritten by the next readLine() before it’s ever used. Easiest fix is to discard the skipped lines without assigning to lineIn, then read the actual avg line once into lineAvg.
| } | ||
|
|
||
| // no unshaded run for now | ||
| NeedUnshadedRun = false; |
There was a problem hiding this comment.
NeedUnshadedRun is possibly set true a few lines before, but then immediately forced to false before it’s ever used, so the earlier assignments are dead. Either drop the unconditional NeedUnshadedRun = false; (to keep the logic), or remove the previous NeedUnshadedRun = true lines would be the fix. As the comment said "no unshaded run for now", I left NeedUnshadedRun = false and erased two NeedUnshadedRun = true lines.
Pull request overview
Description of the purpose of this PR
Pull Request Author
Reviewer