From d0ed7db96b4aedd5b1aa41953637a9361001f6f7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Sat, 30 Dec 2023 15:33:57 +0100 Subject: [PATCH] perf: optimize configuration key visibility test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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 } -- 2.34.1