Bug 1201017 - Remove array.includes() usage in nsBrowserGlue's urlbar telemetry. r=ttaubert a=sylvestre
authorDrew Willcoxon <adw@mozilla.com>
Wed, 02 Sep 2015 11:44:20 -0700
changeset 289115 e714be378aa48b5215ef0c373e6d7a1236d8c7d1
parent 289114 5133f5c9fff0294fab5291c2960eb17768169c03
child 289116 272572ec32e42f039684a3950f64c4c86242cdaa
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersttaubert, sylvestre
bugs1201017
milestone42.0a2
Bug 1201017 - Remove array.includes() usage in nsBrowserGlue's urlbar telemetry. r=ttaubert a=sylvestre
browser/components/nsBrowserGlue.js
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -522,18 +522,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),