Get rid of useless intermediate variable
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 27 Mar 2022 10:41:45 +0000 (12:41 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 27 Mar 2022 10:41:45 +0000 (12:41 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/charging-station/ChargingStation.ts

index 1d18e5b6c06ca9b03f4bcec6abc067fbca37d1af..418035a798685c6d82981320ea1ddf4574766b44 100644 (file)
@@ -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) /