17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-10-17 06:19: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

@@ -367,9 +367,9 @@ drivermouse_input::button( int const Button, int const Action ) {
control->screen_touch_list->emplace_back(pos);
}
auto const controlbindings { bindings( simulation::Train->GetLabel( control ) ) };
auto const [leftbinding, rightbinding]{ bindings( simulation::Train->GetLabel( control ) ) };
// if the recognized element under the cursor has a command associated with the pressed button, notify the recipient
mousecommand = Button == GLFW_MOUSE_BUTTON_LEFT ? controlbindings.first : controlbindings.second;
mousecommand = Button == GLFW_MOUSE_BUTTON_LEFT ? leftbinding : rightbinding;
if( mousecommand == user_command::none ) {
// if we don't have any recognized element under the cursor and the right button was pressed, enter view panning mode