From: Jérôme Benoit Date: Mon, 13 Nov 2023 09:05:20 +0000 (+0100) Subject: refactor: remove unneeded intermediate variable X-Git-Tag: v1.2.24~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=16aee3cf5844ca834e4906e73d504eca61f4a323;p=e-mobility-charging-stations-simulator.git refactor: remove unneeded intermediate variable Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/OCPPServiceUtils.ts b/src/charging-station/ocpp/OCPPServiceUtils.ts index 3a1423c4..8036079a 100644 --- a/src/charging-station/ocpp/OCPPServiceUtils.ts +++ b/src/charging-station/ocpp/OCPPServiceUtils.ts @@ -431,8 +431,7 @@ export class OCPPServiceUtils { }; const parsedValue = parseInt(value); if (options?.limitationEnabled) { - const numberValue = !isNaN(parsedValue) ? parsedValue : Infinity; - return min(numberValue * options.unitMultiplier!, limit); + return min((!isNaN(parsedValue) ? parsedValue : Infinity) * options.unitMultiplier!, limit); } return (!isNaN(parsedValue) ? parsedValue : options.defaultValue!) * options.unitMultiplier!; }