From 74ed61d9509bdf19991b404c0db95af2f7302c70 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sun, 12 Nov 2023 22:38:28 +0100 Subject: [PATCH] refactor(simulator): remove unneeded 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 | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index bcd33ccf..3f3248c9 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -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 { -- 2.34.1