From e9c5e51f251f99a829f1a6ef93fd67303a34eab0 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sat, 21 Jan 2023 17:00:40 -1000 Subject: [PATCH] review --- src/data/history.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/data/history.ts b/src/data/history.ts index 27a1f6ada9..2e296c1c22 100644 --- a/src/data/history.ts +++ b/src/data/history.ts @@ -233,11 +233,11 @@ class HistoryStream { const newHistory: HistoryStates = {}; for (const entityId of Object.keys(this.combinedHistory)) { newHistory[entityId] = []; - }; - Object.keys(streamMessage.states).forEach((entityId) => { + } + for (const entityId of Object.keys(streamMessage.states)) { newHistory[entityId] = []; - }); - Object.keys(newHistory).forEach((entityId) => { + } + for (const entityId of Object.keys(newHistory)) { let purgeOld = entityId in this.combinedHistory; if ( entityId in this.combinedHistory && @@ -277,7 +277,7 @@ class HistoryStream { break; } } - }); + } this.combinedHistory = newHistory; return this.combinedHistory; }