mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-17 06:19:19 +02:00
refactor(sonar): use transparent comparators for string-keyed maps (cpp:S6045)
std::unordered_map instances and map types exposed in headers used by other modules are left as they are.
This commit is contained in:
@@ -111,7 +111,7 @@ basic_controller::update( double const Timestep ) -> int {
|
||||
return run();
|
||||
}
|
||||
|
||||
std::map<std::string, basic_controller::opcode_e> const basic_controller::m_operationcodemap = {
|
||||
std::map<std::string, basic_controller::opcode_e, std::less<>> const basic_controller::m_operationcodemap = {
|
||||
{ "ld", opcode_e::op_ld }, { "ldi", opcode_e::op_ldi },
|
||||
{ "and", opcode_e::op_and }, { "ani", opcode_e::op_ani }, { "anb", opcode_e::op_anb },
|
||||
{ "or", opcode_e::op_or }, { "ori", opcode_e::op_ori }, { "orb", opcode_e::op_orb },
|
||||
|
||||
@@ -116,7 +116,7 @@ private:
|
||||
auto element( element_handle const Element ) -> basic_element & {
|
||||
return m_elements[ Element - 1 ]; }
|
||||
// members
|
||||
static std::map<std::string, basic_controller::opcode_e> const m_operationcodemap;
|
||||
static std::map<std::string, basic_controller::opcode_e, std::less<>> const m_operationcodemap;
|
||||
element_sequence m_elements; // collection of elements accessed by the plc program
|
||||
name_sequence m_elementnames;
|
||||
handle_sequence m_timerhandles; // indices of timer elements, timer update optimization helper
|
||||
|
||||
Reference in New Issue
Block a user