refactor(simulator): remove unneeded intermediate variable
authorJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Nov 2023 21:38:28 +0000 (22:38 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sun, 12 Nov 2023 21:38:28 +0000 (22:38 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index bcd33ccf0ca17b7f595b2d4f9d38fd6299fc7061..3f3248c99e8c95f0bde688a1c6f9e92dced424d7 100644 (file)
@@ -2071,12 +2071,10 @@ export class ChargingStation extends EventEmitter {
   }
 
   private getVoltageOut(stationInfo?: ChargingStationInfo): number {
-    const defaultVoltageOut = getDefaultVoltageOut(
-      this.getCurrentOutType(stationInfo),
-      this.logPrefix(),
-      this.templateFile,
+    return (
+      (stationInfo ?? this.stationInfo).voltageOut ??
+      getDefaultVoltageOut(this.getCurrentOutType(stationInfo), this.logPrefix(), this.templateFile)
     );
-    return (stationInfo ?? this.stationInfo).voltageOut ?? defaultVoltageOut;
   }
 
   private getAmperageLimitation(): number | undefined {