From 32e8c8a50f321cf046fc162f24421cd1d5589200 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Mon, 27 Mar 2023 11:33:24 +0200 Subject: [PATCH] refactor: rename an id tags cache method MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/IdTagsCache.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/charging-station/IdTagsCache.ts b/src/charging-station/IdTagsCache.ts index f19f66f3..8d402783 100644 --- a/src/charging-station/IdTagsCache.ts +++ b/src/charging-station/IdTagsCache.ts @@ -58,7 +58,7 @@ export class IdTagsCache { private getRandomIdTag(hashId: string, file: string): string { const idTags = this.getIdTags(file); - const addressableKey = this.getIdTagsCacheAddressableKey(file, hashId); + const addressableKey = this.getIdTagsCacheIndexesAddressableKey(file, hashId); this.idTagsCachesAddressableIndexes.set( addressableKey, Math.floor(Utils.secureRandom() * idTags.length) @@ -68,7 +68,7 @@ export class IdTagsCache { private getRoundRobinIdTag(hashId: string, file: string): string { const idTags = this.getIdTags(file); - const addressableKey = this.getIdTagsCacheAddressableKey(file, hashId); + const addressableKey = this.getIdTagsCacheIndexesAddressableKey(file, hashId); const idTagIndex = this.idTagsCachesAddressableIndexes.get(addressableKey) ?? 0; const idTag = idTags[idTagIndex]; this.idTagsCachesAddressableIndexes.set( @@ -82,7 +82,7 @@ export class IdTagsCache { const file = ChargingStationUtils.getIdTagsFile(chargingStation.stationInfo); const idTags = this.getIdTags(file); const hashId = chargingStation.stationInfo.hashId; - const addressableKey = this.getIdTagsCacheAddressableKey(file, hashId); + const addressableKey = this.getIdTagsCacheIndexesAddressableKey(file, hashId); this.idTagsCachesAddressableIndexes.set( addressableKey, (chargingStation.index - 1 + (connectorId - 1)) % idTags.length @@ -144,7 +144,7 @@ export class IdTagsCache { } } - private getIdTagsCacheAddressableKey(prefix: string, uid: string): string { + private getIdTagsCacheIndexesAddressableKey(prefix: string, uid: string): string { return `${prefix}${uid}`; } -- 2.34.1