From: Jérôme Benoit Date: Sun, 27 Mar 2022 10:41:45 +0000 (+0200) Subject: Get rid of useless intermediate variable X-Git-Tag: v1.1.57~26 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=4160ae28993e439fd92b9c067b8bdfdd7963515c;p=e-mobility-charging-stations-simulator.git Get rid of useless intermediate variable Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 1d18e5b6..418035a7 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -241,16 +241,15 @@ export default class ChargingStation { !Utils.isNullOrUndefined(this.getAmperageLimitation()) && this.getAmperageLimitation() < this.stationInfo.maximumAmperage ) { - const amperageLimitationPowerLimit = - this.getCurrentOutType() === CurrentType.AC + connectorAmperageLimitationPowerLimit = + (this.getCurrentOutType() === CurrentType.AC ? ACElectricUtils.powerTotal( this.getNumberOfPhases(), this.getVoltageOut(), this.getAmperageLimitation() * this.getNumberOfConnectors() ) - : DCElectricUtils.power(this.getVoltageOut(), this.getAmperageLimitation()); - connectorAmperageLimitationPowerLimit = - amperageLimitationPowerLimit / this.stationInfo.powerDivider; + : DCElectricUtils.power(this.getVoltageOut(), this.getAmperageLimitation())) / + this.stationInfo.powerDivider; } const connectorMaximumPower = ((this.stationInfo['maxPower'] as number) ?? this.stationInfo.maximumPower) /