mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 06:19:19 +02:00
refactor(sonar): scope single-use variables in if init-statements (cpp:S6004)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -123,9 +123,8 @@ TButton::Turn( bool const State ) {
|
||||
void TButton::Update( bool const Power ) {
|
||||
// TODO: remove passing manually power state when LD is in place
|
||||
|
||||
auto const state { Power && ( bData ? *bData : m_state ) };
|
||||
|
||||
if( state != m_state ) {
|
||||
if( auto const state { Power && ( bData ? *bData : m_state ) }; state != m_state ) {
|
||||
|
||||
m_state = state;
|
||||
play();
|
||||
|
||||
Reference in New Issue
Block a user