Skip to content

Commit fbc8e64

Browse files
committed
Code refinements
1 parent d05e5e3 commit fbc8e64

File tree

1 file changed

+3
-10
lines changed

1 file changed

+3
-10
lines changed

Source/Orts.Simulation/Simulation/RollingStocks/SubSystems/Brakes/MSTS/VacuumSinglePipe.cs

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -488,17 +488,10 @@ public override void Update(float elapsedClockSeconds)
488488
{
489489
// the following reduces the brake cylinder and vacuum reservoir to 0inHg if the bleed valve is operated
490490
float dp = elapsedClockSeconds * MaxApplicationRatePSIpS;
491-
VacResPressurePSIA += dp;
492-
if (VacResPressurePSIA > OneAtmospherePSI)
493-
{
494-
VacResPressurePSIA = OneAtmospherePSI;
495-
}
496491

497-
CylPressurePSIA += dp;
498-
if (CylPressurePSIA > OneAtmospherePSI)
499-
{
500-
CylPressurePSIA = OneAtmospherePSI;
501-
}
492+
VacResPressurePSIA = Math.Min(VacResPressurePSIA + dp, OneAtmospherePSI);
493+
494+
CylPressurePSIA = Math.Min(CylPressurePSIA + dp, OneAtmospherePSI);
502495

503496
}
504497
else if (BrakeLine1PressurePSI < VacResPressurePSIA)

0 commit comments

Comments
 (0)