17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-01 03:29:03 +01: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

@@ -624,11 +624,11 @@ bool TMoverParameters::Attach(int ConnectNo, int ConnectToNr, TMoverParameters *
std::vector<std::pair<coupling, sound>> const soundmappings = {{coupling::coupler, sound::attachcoupler}, {coupling::brakehose, sound::attachbrakehose},
{coupling::mainhose, sound::attachmainhose}, {coupling::control, sound::attachcontrol},
{coupling::gangway, sound::attachgangway}, {coupling::heating, sound::attachheating}};
for (auto const &soundmapping : soundmappings)
for (auto const &[mappingcoupling, mappingsound] : soundmappings)
{
if ((couplingchange & soundmapping.first) != 0)
if ((couplingchange & mappingcoupling) != 0)
{
soundflag |= soundmapping.second;
soundflag |= mappingsound;
}
}
SetFlag(coupler.sounds, soundflag);
@@ -685,11 +685,11 @@ bool TMoverParameters::Dettach(int ConnectNo)
std::vector<std::pair<coupling, sound>> const soundmappings = {{coupling::coupler, sound::attachcoupler}, {coupling::brakehose, sound::attachbrakehose},
{coupling::mainhose, sound::attachmainhose}, {coupling::control, sound::attachcontrol},
{coupling::gangway, sound::attachgangway}, {coupling::heating, sound::attachheating}};
for (auto const &soundmapping : soundmappings)
for (auto const &[mappingcoupling, mappingsound] : soundmappings)
{
if ((couplingchange & soundmapping.first) != 0)
if ((couplingchange & mappingcoupling) != 0)
{
soundflag |= soundmapping.second;
soundflag |= mappingsound;
}
}
SetFlag(coupler.sounds, soundflag);