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

refactor(sonar): use try_emplace for map insertion (cpp:S6030)

This commit is contained in:
jerrrrycho
2026-10-10 15:51:29 +02:00
parent 8d93367de7
commit f8c6e358bd
17 changed files with 64 additions and 64 deletions

View File

@@ -167,7 +167,7 @@ gamepad_input::recall_bindings() {
std::unordered_map<std::string, user_command> nametocommandmap;
std::size_t commandid = 0;
for( auto const &description : simulation::Commands_descriptions ) {
nametocommandmap.emplace(
nametocommandmap.try_emplace(
description.name,
static_cast<user_command>( commandid ) );
++commandid;