refactor: forEach -> for ... of
authorJérôme Benoit <jerome.benoit@sap.com>
Fri, 14 Apr 2023 09:39:57 +0000 (11:39 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Fri, 14 Apr 2023 09:39:57 +0000 (11:39 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
src/charging-station/ChargingStation.ts

index 8bf8d6ae3b153e3ee0aefa49c3c9c083fd037116..a60f877174635e64a4c66f798e7e8869e495eb51 100644 (file)
@@ -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);
-      });
+      }
     }
   }