From 7d3b0f64262e8ffe47e2e8b5b091dfcdb6b67339 Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Fri, 14 Apr 2023 11:39:57 +0200 Subject: [PATCH] refactor: forEach -> for ... of MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/charging-station/ChargingStation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/charging-station/ChargingStation.ts b/src/charging-station/ChargingStation.ts index 8bf8d6ae..a60f8771 100644 --- a/src/charging-station/ChargingStation.ts +++ b/src/charging-station/ChargingStation.ts @@ -796,7 +796,7 @@ export class ChargingStation { private flushMessageBuffer(): void { if (this.messageBuffer.size > 0) { - this.messageBuffer.forEach((message) => { + for (const message of this.messageBuffer.values()) { let beginId: string; let commandName: RequestCommand; const [messageType] = JSON.parse(message) as OutgoingRequest | Response | ErrorResponse; @@ -813,7 +813,7 @@ export class ChargingStation { )} payload sent: ${message}` ); this.messageBuffer.delete(message); - }); + } } } -- 2.34.1