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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user