(No bug) Replace misuse of Array.some() r=kmag
authorAndrew Swan <aswan@mozilla.com>
Thu, 01 Dec 2016 14:54:47 -0800
changeset 372320 2fcb49a693ff0bc5820c88f2aaaeec2a85c56680
parent 372319 c0efbd59ccc496dae32715a9730a76d0639ffdfe
child 372321 2b930547912204ee4d32c62ae79c281dcc9a8213
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
milestone53.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
(No bug) Replace misuse of Array.some() r=kmag MozReview-Commit-ID: 5DpG14EcJCE
toolkit/modules/PopupNotifications.jsm
--- a/toolkit/modules/PopupNotifications.jsm
+++ b/toolkit/modules/PopupNotifications.jsm
@@ -254,20 +254,18 @@ PopupNotifications.prototype = {
    * @param browser
    *        The browser whose notifications should be searched. If null, the
    *        currently selected browser's notifications will be searched.
    *
    * @returns the corresponding Notification object, or null if no such
    *          notification exists.
    */
   getNotification: function PopupNotifications_getNotification(id, browser) {
-    let n = null;
     let notifications = this._getNotificationsForBrowser(browser || this.tabbrowser.selectedBrowser);
-    notifications.some(x => x.id == id && (n = x));
-    return n;
+    return notifications.find(x => x.id == id) || null;
   },
 
   /**
    * Adds a new popup notification.
    * @param browser
    *        The <xul:browser> element associated with the notification. Must not
    *        be null.
    * @param id