17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 12:09:19 +02:00

refactor(sonar): use structured bindings for pair access (cpp:S6005)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
jerrrrycho
2026-10-10 16:06:32 +02:00
parent 9c7043d013
commit b6349b76e3
18 changed files with 152 additions and 152 deletions

View File

@@ -154,8 +154,8 @@ basic_controller::deserialize_operation( cParser &Input ) -> bool {
}
if( false == operationparameter.empty() ) {
auto const parameter{ split_string_and_number( operationparameter ) };
operation.parameter1 = static_cast<short>( parameter.second );
auto const [parametertype, parameterindex]{ split_string_and_number( operationparameter ) };
operation.parameter1 = static_cast<short>( parameterindex );
}
m_program.emplace_back( operation );
@@ -380,12 +380,12 @@ basic_controller::log_error( std::string const &Error, int const Line ) const {
auto
basic_controller::guess_element_type_from_name( std::string const &Name ) const -> basic_element::type_e {
auto const name { split_string_and_number( Name ) };
auto const [nametype, nameindex]{ split_string_and_number( Name ) };
if( name.first == "t" || name.first == "ton" || name.first.find("timer.") == 0 ) {
if( nametype == "t" || nametype == "ton" || nametype.find("timer.") == 0 ) {
return basic_element::type_e::timer;
}
if( name.first == "c" || name.first.find("counter.") == 0 ) {
if( nametype == "c" || nametype.find("counter.") == 0 ) {
return basic_element::type_e::counter;
}