From 4160ae28993e439fd92b9c067b8bdfdd7963515c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 27 Mar 2022 12:41:45 +0200 Subject: [PATCH] Get rid of useless intermediate variable MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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) / -- 2.34.1