From: Jérôme Benoit Date: Fri, 14 Apr 2023 09:39:57 +0000 (+0200) Subject: refactor: forEach -> for ... of X-Git-Tag: v1.2.8~3 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=7d3b0f64262e8ffe47e2e8b5b091dfcdb6b67339;p=e-mobility-charging-stations-simulator.git refactor: forEach -> for ... of Signed-off-by: Jérôme Benoit --- 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); - }); + } } }