From: Jérôme Benoit Date: Sat, 30 Dec 2023 14:33:57 +0000 (+0100) Subject: perf: optimize configuration key visibility test X-Git-Tag: v1.2.31~4 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=d0ed7db96b4aedd5b1aa41953637a9361001f6f7;p=e-mobility-charging-stations-simulator.git perf: optimize configuration key visibility test Signed-off-by: Jérôme Benoit --- diff --git a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts index d99e721e..bbdf2e51 100644 --- a/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts +++ b/src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts @@ -38,7 +38,7 @@ import { type OCPP16SupportedFeatureProfiles, OCPPVersion } from '../../../types/index.js' -import { cloneObject, isNotEmptyArray, logger, roundTo } from '../../../utils/index.js' +import { isNotEmptyArray, logger, roundTo } from '../../../utils/index.js' import { OCPPServiceUtils } from '../OCPPServiceUtils.js' export class OCPP16ServiceUtils extends OCPPServiceUtils { @@ -434,8 +434,7 @@ export class OCPP16ServiceUtils extends OCPPServiceUtils { public static isConfigurationKeyVisible (key: ConfigurationKey): boolean { if (key.visible == null) { - key = cloneObject(key) - key.visible = true + return true } return key.visible }