17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 07:29:20 +02:00

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

This commit is contained in:
jerrrrycho
2026-10-10 16:06:32 +02:00
parent 71b338f30e
commit 560512bd9e
18 changed files with 152 additions and 152 deletions

View File

@@ -330,9 +330,9 @@ void
keyboard_input::bind() {
m_bindings.clear();
for( auto const &bindingsetup : m_bindingsetups ) {
for( auto const &[setupcommand, setupbinding] : m_bindingsetups ) {
m_bindings[ std::get<int>(bindingsetup.second) ] = bindingsetup.first;
m_bindings[ std::get<int>(setupbinding) ] = setupcommand;
}
// cache movement key bindings
@@ -347,9 +347,9 @@ keyboard_input::bind() {
int
keyboard_input::binding( user_command const Command ) const {
for( auto const &binding : m_bindings ) {
if( binding.second == Command ) {
return binding.first;
for( auto const &[bindingkey, bindingcommand] : m_bindings ) {
if( bindingcommand == Command ) {
return bindingkey;
}
}
return -1;