Bug 1201017 - Remove array.includes() usage in nsBrowserGlue's urlbar telemetry. r=ttaubert
authorDrew Willcoxon <adw@mozilla.com>
Wed, 02 Sep 2015 11:44:20 -0700
changeset 260528 934ff69fca49416ff533a0b2a7ed9053bf078506
parent 260527 5f17da82fc01a30de1b0add8560200bafa051602
child 260529 5f6c64cb49dcac3baa69867c4c817570732de1c2
push id15004
push userdwillcoxon@mozilla.com
push dateWed, 02 Sep 2015 18:44:38 +0000
treeherderfx-team@5f6c64cb49dc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert
bugs1201017
milestone43.0a1
Bug 1201017 - Remove array.includes() usage in nsBrowserGlue's urlbar telemetry. r=ttaubert
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -525,18 +525,18 @@ BrowserGlue.prototype = {
     let actionType;
     if (action) {
       actionType =
         action.type == "searchengine" && action.params.searchSuggestion ?
           "searchsuggestion" :
         action.type;
     }
     if (!actionType) {
-      let styles = controller.getStyleAt(idx).split(/\s+/);
-      let style = ["autofill", "tag", "bookmark"].find(s => styles.includes(s));
+      let styles = new Set(controller.getStyleAt(idx).split(/\s+/));
+      let style = ["autofill", "tag", "bookmark"].find(s => styles.has(s));
       actionType = style || "history";
     }
 
     Services.telemetry
             .getHistogramById("FX_URLBAR_SELECTED_RESULT_INDEX")
             .add(idx);
 
     // Ideally this would be a keyed histogram and we'd just add(actionType),