refactor(sdcard): extract shared ScaleRawAnalogValues helper - #466
Conversation
The three SD-card parsers (protobuf, CSV, JSON) each carried a byte-identical ScaleRawAnalogValues body plus the same doc remarks. Extracted into internal SdCardAnalogScaling.ScaleRawAnalogValues, which all three now delegate to. Pure refactor; no behavior change. Closes #462 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
/agentic_review |
PR Summary by QodoRefactor SD-card parsers to share ScaleRawAnalogValues helper
AI Description
Diagram
High-Level Assessment
Files changed (4)
|
Code Review by Qodo
1.
|
Address Qodo feedback on PR #466: the protobuf raw-int path was converting RepeatedField<int> to double[] before calling the shared scaler, which then allocated a second array — two allocations per record instead of one. Added an IReadOnlyList<int> overload of SdCardAnalogScaling.ScaleRawAnalogValues that reads raw counts directly, so the protobuf path allocates only the result array. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 8ffda79 |
Qodo feedback on PR #466: the int overload's no-config branch copies raw counts into a newly allocated double[], but the inline comment said "return raw values as-is" (true of the double overload, not this one). Clarified wording and the <returns> doc to match actual behavior. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 0011c70 |
Summary
ScaleRawAnalogValuesbodies (and their copy-pasted<remarks>doc block) out ofSdCardFileParser,SdCardCsvFileParser, andSdCardJsonFileParserinto a single internalSdCardAnalogScaling.ScaleRawAnalogValueshelper.AnalogScaling.Scale(unchanged).SdCardFileParser's protobuf path converts itsRepeatedField<int>todouble[]before calling the shared helper, matching the CSV/JSON parsers'IReadOnlyList<double>signature.Pure refactor — no behavior change.
Closes #462
Test plan
dotnet build— 0 warnings, 0 errorsdotnet test(SD-card filter) — 405/405 passeddotnet test(full suite) — 2826/2826 passed, 2 skipped (pre-existing)🤖 Generated with Claude Code