summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/zero_suggest_provider.cc
diff options
context:
space:
mode:
authorpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-24 21:50:23 +0000
committerpkasting@chromium.org <pkasting@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-06-24 21:50:23 +0000
commitbc8bb0cdeb9c53888f72f9de67a3f32d3e5dc13a (patch)
tree9d31ea07c98a7ca2b7c2b05639adfd306e4ef8db /chrome/browser/autocomplete/zero_suggest_provider.cc
parent0f95b763bab7296f59b041fee237d7ad71b4cb63 (diff)
downloadchromium_src-bc8bb0cdeb9c53888f72f9de67a3f32d3e5dc13a.zip
chromium_src-bc8bb0cdeb9c53888f72f9de67a3f32d3e5dc13a.tar.gz
chromium_src-bc8bb0cdeb9c53888f72f9de67a3f32d3e5dc13a.tar.bz2
Cleanup split off from https://codereview.chromium.org/17382015/ .
This reorders the declarations in search_provider.h to comply with the style guide (e.g. contructors/destructors before other methods within the section; functions above data members) and tries to otherwise order things as "statics, virtuals, nonvirtuals". Makes .cc order match .h order. Also other small cleanups, comment fixes, etc. There is also some re-wrapping that's mostly aimed at minimizing the diff of the other CL, which is going to add more parameters to some of the calls. BUG=none TEST=none R=msw@chromium.org Review URL: https://codereview.chromium.org/17029022 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@208267 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/zero_suggest_provider.cc')
-rw-r--r--chrome/browser/autocomplete/zero_suggest_provider.cc16
1 files changed, 6 insertions, 10 deletions
diff --git a/chrome/browser/autocomplete/zero_suggest_provider.cc b/chrome/browser/autocomplete/zero_suggest_provider.cc
index b210f5a..6cc2fd5 100644
--- a/chrome/browser/autocomplete/zero_suggest_provider.cc
+++ b/chrome/browser/autocomplete/zero_suggest_provider.cc
@@ -335,9 +335,8 @@ void ZeroSuggestProvider::AddMatchToMap(const string16& query_string,
// Try to add |match| to |map|. If a match for |query_string| is already in
// |map|, replace it if |match| is more relevant.
// NOTE: Keep this ToLower() call in sync with url_database.cc.
- const std::pair<SearchProvider::MatchMap::iterator, bool> i = map->insert(
- std::pair<string16, AutocompleteMatch>(
- base::i18n::ToLower(query_string), match));
+ const std::pair<SearchProvider::MatchMap::iterator, bool> i(map->insert(
+ std::make_pair(base::i18n::ToLower(query_string), match)));
// NOTE: We purposefully do a direct relevance comparison here instead of
// using AutocompleteMatch::MoreRelevant(), so that we'll prefer "items added
// first" rather than "items alphabetically first" when the scores are equal.
@@ -462,16 +461,13 @@ void ZeroSuggestProvider::ConvertResultsToAutocompleteMatches(
0 : string16::npos;
matches_.push_back(current_url_match_);
- for (SearchProvider::MatchMap::const_iterator it = query_matches_map_.begin();
- it != query_matches_map_.end(); ++it) {
+ for (SearchProvider::MatchMap::const_iterator it(query_matches_map_.begin());
+ it != query_matches_map_.end(); ++it)
matches_.push_back(it->second);
- }
- for (SearchProvider::NavigationResults::const_iterator it =
- navigation_results_.begin();
- it != navigation_results_.end(); ++it) {
+ for (SearchProvider::NavigationResults::const_iterator it(
+ navigation_results_.begin()); it != navigation_results_.end(); ++it)
matches_.push_back(NavigationToMatch(*it));
- }
}
AutocompleteMatch ZeroSuggestProvider::MatchForCurrentURL() {