perf: optimize configuration key visibility test
authorJérôme Benoit <jerome.benoit@sap.com>
Sat, 30 Dec 2023 14:33:57 +0000 (15:33 +0100)
committerJérôme Benoit <jerome.benoit@sap.com>
Sat, 30 Dec 2023 14:33:57 +0000 (15:33 +0100)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ocpp/1.6/OCPP16ServiceUtils.ts

index d99e721e2d153a58a55b56090dc5731ffaef6da3..bbdf2e51a8eac5b5d08d18252eb939f22c66724d 100644 (file)
@@ -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
   }