From: Jérôme Benoit Date: Sun, 12 Nov 2023 21:38:28 +0000 (+0100) Subject: refactor(simulator): remove unneeded intermediate variable X-Git-Tag: v1.2.24~6 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=74ed61d9509bdf19991b404c0db95af2f7302c70;p=e-mobility-charging-stations-simulator.git refactor(simulator): remove unneeded intermediate variable Signed-off-by: Jérôme Benoit --- 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 {