mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-07 20:16:08 +01:00
refactor(sonar): avoid side effects inside typeid operands (cpp:S5279)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -319,7 +319,9 @@ void TNESt3::Init( double const PP, double const HPP, double const LPP, double c
|
|||||||
|
|
||||||
Zamykajacy = false;
|
Zamykajacy = false;
|
||||||
|
|
||||||
if ( typeid(*FM) == typeid(TDisk1) || typeid(*FM) == typeid(TDisk2) ) // jesli zeliwo to schodz
|
auto const &frictionmaterial { *FM };
|
||||||
|
auto const &frictionmaterialtype { typeid( frictionmaterial ) };
|
||||||
|
if ( frictionmaterialtype == typeid(TDisk1) || frictionmaterialtype == typeid(TDisk2) ) // jesli zeliwo to schodz
|
||||||
RapidStaly = true;
|
RapidStaly = true;
|
||||||
else
|
else
|
||||||
RapidStaly = false;
|
RapidStaly = false;
|
||||||
|
|||||||
@@ -2675,7 +2675,9 @@ double TKE::GetPF(double const PP, double const dt, double const Vel)
|
|||||||
ImplsRes->Flow(-dv);
|
ImplsRes->Flow(-dv);
|
||||||
|
|
||||||
// rapid
|
// rapid
|
||||||
if (!(typeid(*FM) == typeid(TDisk1) || typeid(*FM) == typeid(TDisk2))) // jesli zeliwo to schodz
|
auto const &frictionmaterial{*FM};
|
||||||
|
auto const &frictionmaterialtype{typeid(frictionmaterial)};
|
||||||
|
if (!(frictionmaterialtype == typeid(TDisk1) || frictionmaterialtype == typeid(TDisk2))) // jesli zeliwo to schodz
|
||||||
RapidStatus = (BrakeDelayFlag & bdelay_R) == bdelay_R && (RV < 0 || (Vel > RV && RapidStatus) || Vel > RV + 20);
|
RapidStatus = (BrakeDelayFlag & bdelay_R) == bdelay_R && (RV < 0 || (Vel > RV && RapidStatus) || Vel > RV + 20);
|
||||||
else // jesli tarczowki, to zostan
|
else // jesli tarczowki, to zostan
|
||||||
RapidStatus = (BrakeDelayFlag & bdelay_R) == bdelay_R;
|
RapidStatus = (BrakeDelayFlag & bdelay_R) == bdelay_R;
|
||||||
|
|||||||
@@ -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;
|
bool const bEP = mvControlled->LocHandle->GetCP() > 0.2 || fEIMParams[0][5] > 0.01;
|
||||||
dict->insert("dir_brake", bEP);
|
dict->insert("dir_brake", bEP);
|
||||||
bool bPN{false};
|
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();
|
TBrake *temp_ham = mvOccupied->Hamulec.get();
|
||||||
|
|||||||
Reference in New Issue
Block a user