From 7ba8c7c2b57066c6eb398a7404c8e059052e7bfd Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Wed, 2 May 2012 15:31:01 -0400 Subject: [PATCH] search: Remove unused MUTLIPLE_* match types https://bugzilla.gnome.org/show_bug.cgi?id=675328 --- js/ui/placeDisplay.js | 13 +++---------- js/ui/search.js | 4 +--- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/js/ui/placeDisplay.js b/js/ui/placeDisplay.js index 8441282c5..c3117df49 100644 --- a/js/ui/placeDisplay.js +++ b/js/ui/placeDisplay.js @@ -396,9 +396,7 @@ const PlaceSearchProvider = new Lang.Class({ }, _searchPlaces: function(places, terms) { - let multiplePrefixResults = []; let prefixResults = []; - let multipleSubstringResults = []; let substringResults = []; terms = terms.map(String.toLowerCase); @@ -406,20 +404,15 @@ const PlaceSearchProvider = new Lang.Class({ for (let i = 0; i < places.length; i++) { let place = places[i]; let mtype = place.matchTerms(terms); - if (mtype == Search.MatchType.MULTIPLE_PREFIX) - multiplePrefixResults.push(place.id); - else if (mtype == Search.MatchType.PREFIX) + if (mtype == Search.MatchType.PREFIX) prefixResults.push(place.id); - else if (mtype == Search.MatchType.MULTIPLE_SUBSTRING) - multipleSubstringResults.push(place.id); else if (mtype == Search.MatchType.SUBSTRING) substringResults.push(place.id); } - multiplePrefixResults.sort(this._compareResultMeta); prefixResults.sort(this._compareResultMeta); - multipleSubstringResults.sort(this._compareResultMeta); substringResults.sort(this._compareResultMeta); - return multiplePrefixResults.concat(prefixResults.concat(multipleSubstringResults.concat(substringResults))); + + return prefixResults.concat(substringResults); }, getInitialResultSet: function(terms) { diff --git a/js/ui/search.js b/js/ui/search.js index b2348d5d2..98de089d2 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -18,9 +18,7 @@ const DISABLED_OPEN_SEARCH_PROVIDERS_KEY = 'disabled-open-search-providers'; const MatchType = { NONE: 0, SUBSTRING: 1, - MULTIPLE_SUBSTRING: 2, - PREFIX: 3, - MULTIPLE_PREFIX: 4 + PREFIX: 2 }; const SearchResultDisplay = new Lang.Class({