Bug 1211726 - fix nits, r?gijs draft
authorSvetlana Orlik <sveta.orlik.code@gmail.com>
Thu, 22 Dec 2016 22:01:16 +0300
changeset 453344 049175faa551cc48b9dfe0b81cbdb493158c3844
parent 449540 5a3c3a4f6795abefa20bdecfb37d47f63e2f9654
child 453345 4faa9a83ec3870040e7fc8e19a6df813d48b77ec
push id39636
push userbmo:sveta.orlik.code@gmail.com
push dateFri, 23 Dec 2016 07:50:26 +0000
reviewersgijs
bugs1211726
milestone53.0a1
Bug 1211726 - fix nits, r?gijs MozReview-Commit-ID: BRXelrBabHH
toolkit/components/places/UnifiedComplete.js
--- a/toolkit/components/places/UnifiedComplete.js
+++ b/toolkit/components/places/UnifiedComplete.js
@@ -765,17 +765,16 @@ function Search(searchString, searchPara
   this._localMatchesStartIndex = 0;
 
   // Counts the number of inserted local matches.
   this._localMatchesCount = 0;
   // Counts the number of inserted remote matches.
   this._remoteMatchesCount = 0;
   // Counts the number of inserted extension matches.
   this._extensionMatchesCount = 0;
-
 }
 
 Search.prototype = {
   /**
    * Enables the desired AutoComplete behavior.
    *
    * @param type
    *        The behavior type to set.
@@ -945,21 +944,19 @@ Search.prototype = {
     // to true so that when the result is added, "heuristic" can be included in
     // its style.
     this._addingHeuristicFirstMatch = true;
     let hasHeuristic = yield this._matchFirstHeuristicResult(conn);
     this._addingHeuristicFirstMatch = false;
     if (!this.pending)
       return;
 
-    //--------------------------------------------------------------------
     yield this._matchTop500()
     if (!this.pending)
       return;
-    //--------------------------------------------------------------------
 
     // We sleep a little between adding the heuristicFirstMatch and matching
     // any other searches so we aren't kicking off potentially expensive
     // searches on every keystroke.
     // Though, if there's no heuristic result, we start searching immediately,
     // since autocomplete may be waiting for us.
     if (hasHeuristic) {
       yield this._sleep(Prefs.delay);
@@ -1009,33 +1006,31 @@ Search.prototype = {
     } else if (ExtensionSearchHandler.hasActiveInputSession()) {
       ExtensionSearchHandler.handleInputCancelled();
     }
 
     // Ensure to fill any remaining space. Suggestions which come from extensions are
     // inserted at the beginning, so any suggestions
     yield Promise.all(this._remoteMatchesPromises);
   }),
-  
-  //--------------------------------------------------------------------
+
   *_matchTop500() {
     for (let [url, title] of TOP500_SITES) {
       if (url.toLowerCase().includes(this._searchString) ||
           title.toLowerCase().includes(this._searchString)) {
         let match = {
           value: url,
           comment: url + " - " + title,  // More convenient look
           style: "bookmark",
           frecency: FRECENCY_DEFAULT + 1,
         };
         this._addMatch(match);
       };
     };
   },
-  //--------------------------------------------------------------------
 
   *_matchFirstHeuristicResult(conn) {
     // We always try to make the first result a special "heuristic" result.  The
     // heuristics below determine what type of result it will be, if any.
 
     let hasSearchTerms = this._searchTokens.length > 0;
 
     if (hasSearchTerms) {