Follow-up to PR #2073 (cc @jensenpat).
MeterModel.h:167 declares:
But MeterModel::clear() (MeterModel.cpp) resets it to -1:
So a freshly-constructed MeterModel reports active slice 0, but a cleared (post-disconnect) MeterModel reports -1. Functionally harmless because clear() always runs on disconnect before any TX activity could plausibly target slice 0, but the inconsistency is worth tightening.
Suggested fix
One-line change in the header:
Then either:
- Drop the matching assignment from
clear() (now redundant), or
- Leave both for symmetry with the rest of
clear()'s "reset to default" pattern.
Either is fine. Whichever reads cleaner — I'd leave both for symmetry.
Why this is a good-first-issue
- One-line edit
- No tests need updating (existing tests that call
setActiveTxSlice(0) already pass)
- Build + run
./build/meter_model_test to verify, no behavior change
cc @jensenpat — flagged this during review of #2073, didn't want to block the merge over it.
Follow-up to PR #2073 (cc @jensenpat).
MeterModel.h:167declares:But
MeterModel::clear()(MeterModel.cpp) resets it to-1:m_activeTxSlice = -1;So a freshly-constructed
MeterModelreports active slice 0, but a cleared (post-disconnect)MeterModelreports -1. Functionally harmless becauseclear()always runs on disconnect before any TX activity could plausibly target slice 0, but the inconsistency is worth tightening.Suggested fix
One-line change in the header:
Then either:
clear()(now redundant), orclear()'s "reset to default" pattern.Either is fine. Whichever reads cleaner — I'd leave both for symmetry.
Why this is a good-first-issue
setActiveTxSlice(0)already pass)./build/meter_model_testto verify, no behavior changecc @jensenpat — flagged this during review of #2073, didn't want to block the merge over it.