17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-03 17:50:21 +01:00

refactor(sonar): avoid side effects inside typeid operands (cpp:S5279)

This commit is contained in:
jerrrrycho
2026-10-10 16:26:40 +02:00
parent a510996dc7
commit f82b12b2c6
3 changed files with 9 additions and 3 deletions

View File

@@ -767,7 +767,9 @@ std::shared_ptr<dictionary_source> TTrain::GetTrainState(dictionary_source const
bool const bEP = mvControlled->LocHandle->GetCP() > 0.2 || fEIMParams[0][5] > 0.01;
dict->insert("dir_brake", bEP);
bool bPN{false};
if (typeid(*mvOccupied->Hamulec) == typeid(TLSt) || typeid(*mvOccupied->Hamulec) == typeid(TEStED))
auto const &brakevalve{*mvOccupied->Hamulec};
auto const &brakevalvetype{typeid(brakevalve)};
if (brakevalvetype == typeid(TLSt) || brakevalvetype == typeid(TEStED))
{
TBrake *temp_ham = mvOccupied->Hamulec.get();