summaryrefslogtreecommitdiff
path: root/ext/broadcast_channel
diff options
context:
space:
mode:
authorKenta Moriuchi <moriken@kimamass.com>2023-01-06 21:45:23 +0900
committerGitHub <noreply@github.com>2023-01-06 21:45:23 +0900
commitff89ff4abba39ce158056d390e761495f5a7bc86 (patch)
tree03a9c71b5bb3889842db06ed41c3999074c4107a /ext/broadcast_channel
parent39cbaa6d34c249afc4b197836da1fa6dd143cbf9 (diff)
perf(ext,runtime): remove using `SafeArrayIterator` from `for-of` (#17255)
Diffstat (limited to 'ext/broadcast_channel')
-rw-r--r--ext/broadcast_channel/01_broadcast_channel.js5
1 files changed, 3 insertions, 2 deletions
diff --git a/ext/broadcast_channel/01_broadcast_channel.js b/ext/broadcast_channel/01_broadcast_channel.js
index 11b65b9b5..cf3b17ac5 100644
--- a/ext/broadcast_channel/01_broadcast_channel.js
+++ b/ext/broadcast_channel/01_broadcast_channel.js
@@ -16,7 +16,6 @@
ArrayPrototypeIndexOf,
ArrayPrototypeSplice,
ArrayPrototypePush,
- SafeArrayIterator,
Symbol,
Uint8Array,
} = window.__bootstrap.primordials;
@@ -44,7 +43,9 @@
}
function dispatch(source, name, data) {
- for (const channel of new SafeArrayIterator(channels)) {
+ for (let i = 0; i < channels.length; ++i) {
+ const channel = channels[i];
+
if (channel === source) continue; // Don't self-send.
if (channel[_name] !== name) continue;
if (channel[_closed]) continue;