Bug 1693883 - use for .. of loops for gMessageListeners. r=aleca a=wsmwk
authorMagnus Melin <mkmelin+mozilla@iki.fi>
Tue, 23 Feb 2021 12:57:30 +0200
changeset 41368 6613590cabcb58f24b7ad42853c580034eefff37
parent 41367 94530b012ea19bef3a698fdee228f567872dec53
child 41369 ad4d383ac29bee4fcddbed07ebea9b1460424bf0
push id2989
push userthunderbird@calypsoblue.org
push dateMon, 01 Mar 2021 19:24:13 +0000
treeherdercomm-beta@c96075bebc30 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleca, wsmwk
bugs1693883
Bug 1693883 - use for .. of loops for gMessageListeners. r=aleca a=wsmwk
mail/base/content/msgHdrView.js
--- a/mail/base/content/msgHdrView.js
+++ b/mail/base/content/msgHdrView.js
@@ -479,27 +479,27 @@ var messageHeaderSink = {
     }
 
     ClearCurrentHeaders();
     gBuiltExpandedView = false;
     gBuildAttachmentsForCurrentMsg = false;
     ClearAttachmentList();
     gMessageNotificationBar.clearMsgNotifications();
 
-    for (let index in gMessageListeners) {
-      gMessageListeners[index].onStartHeaders();
+    for (let listener of gMessageListeners) {
+      listener.onStartHeaders();
     }
   },
 
   onEndHeaders() {
     // Give add-ons a chance to modify currentHeaderData before it actually
     // gets displayed.
-    for (let index in gMessageListeners) {
-      if ("onBeforeShowHeaderPane" in gMessageListeners[index]) {
-        gMessageListeners[index].onBeforeShowHeaderPane();
+    for (let listener of gMessageListeners) {
+      if ("onBeforeShowHeaderPane" in listener) {
+        listener.onBeforeShowHeaderPane();
       }
     }
 
     // Load feed web page if so configured. This entry point works for
     // messagepane loads in 3pane folder tab, 3pane message tab, and the
     // standalone message window.
     if (
       !FeedMessageHandler.shouldShowSummary(
@@ -522,18 +522,18 @@ var messageHeaderSink = {
     // Only update the expanded view if it's actually selected and needs updating.
     if (!gBuiltExpandedView) {
       UpdateExpandedMessageHeaders();
     }
 
     gMessageNotificationBar.setDraftEditMessage();
     UpdateJunkButton();
 
-    for (let index in gMessageListeners) {
-      gMessageListeners[index].onEndHeaders();
+    for (let listener of gMessageListeners) {
+      listener.onEndHeaders();
     }
   },
 
   processHeaders(
     headerNameEnumerator,
     headerValueEnumerator,
     dontCollectAddress
   ) {