From 74720f250e51f9f7ae65b9be18cfde53b7103ae9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marco=20Trevisan=20=28Trevi=C3=B1o=29?= Date: Wed, 6 Jul 2022 17:47:14 +0200 Subject: [PATCH] signalTracker: Avoid creating a temporary keys array when clearing We used to create a temporary array of signal tracker keys and then to iterate through them in order to untrack the objects, but the Map's can be iterated directly so let's just use their native forEach. Part-of: --- js/misc/signalTracker.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/misc/signalTracker.js b/js/misc/signalTracker.js index 30d19a27f..e01bec5b1 100644 --- a/js/misc/signalTracker.js +++ b/js/misc/signalTracker.js @@ -138,7 +138,7 @@ class SignalTracker { * @returns {void} */ clear() { - [...this._map.keys()].forEach(obj => this.untrack(obj)); + this._map.forEach((_, obj) => this.untrack(obj)); } /**