mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 13:19:20 +02:00
refactor(sonar): use structured bindings for pair access (cpp:S6005)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user