Bug 1286947 - Replace unconditional break in loop with code that does not use a loop. r=gijs
authorKirk Steuber <ksteuber@mozilla.com>
Thu, 14 Jul 2016 13:24:42 -0700
changeset 330839 4680463ffdd7f2d54f6e3ff9e71495196760d079
parent 330838 4f3556a9addc454d21d1f874f270eddc8f41577e
child 330840 f3a496da670e8040a5ed42bcbc1cbde4415f48d1
push id9858
push userjlund@mozilla.com
push dateMon, 01 Aug 2016 14:37:10 +0000
treeherdermozilla-aurora@203106ef6cb6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgijs
bugs1286947
milestone50.0a1
Bug 1286947 - Replace unconditional break in loop with code that does not use a loop. r=gijs MozReview-Commit-ID: 1Pv3SMkJX44
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -835,19 +835,19 @@ PopupNotifications.prototype = {
         // notifications inside an iconBox.
         anchors = this._getAnchorsForNotifications(notificationsToShow);
       } else if (anchors.size) {
         this._updateAnchorIcons(notifications, anchors);
       }
     }
 
     if (notificationsToShow.length > 0) {
-      for (let anchorElement of anchors) {
+      let anchorElement = anchors.values().next().value;
+      if (anchorElement) {
         this._showPanel(notificationsToShow, anchorElement);
-        break;
       }
     } else {
       // Notify observers that we're not showing the popup (useful for testing)
       this._notify("updateNotShowing");
 
       // Close the panel if there are no notifications to show.
       // When called from PopupNotifications.show() we should never close the
       // panel, however. It may just be adding a dismissed notification, in