Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(912)

Unified Diff: chrome/browser/history/query_parser.cc

Issue 184663002: Omnibox: Make URLs of Bookmarks Searchable (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/history/query_parser.cc
diff --git a/chrome/browser/history/query_parser.cc b/chrome/browser/history/query_parser.cc
index 457a6fb7d0c1e336a000a06c345ddd8b4912e54c..0a77ff0720a2ae99aa526eab63d7f74cd536fb14 100644
--- a/chrome/browser/history/query_parser.cc
+++ b/chrome/browser/history/query_parser.cc
@@ -45,16 +45,6 @@ void CoalesceMatchesFrom(size_t index, Snippet::MatchPositions* matches) {
}
}
-// Sorts the match positions in |matches| by their first index, then coalesces
-// any match positions that intersect each other.
-void CoalseAndSortMatchPositions(Snippet::MatchPositions* matches) {
- std::sort(matches->begin(), matches->end(), &CompareMatchPosition);
- // WARNING: we don't use iterator here as CoalesceMatchesFrom may remove
- // from matches.
- for (size_t i = 0; i < matches->size(); ++i)
- CoalesceMatchesFrom(i, matches);
-}
-
// Returns true if the character is considered a quote.
bool IsQueryQuote(wchar_t ch) {
return ch == '"' ||
@@ -467,7 +457,17 @@ void QueryParser::ExtractQueryWords(const base::string16& text,
words->push_back(QueryWord());
words->back().word = word;
words->back().position = iter.prev();
- }
+ }
}
}
}
+
+// static
+void QueryParser::CoalseAndSortMatchPositions(
+ Snippet::MatchPositions* matches) {
+ std::sort(matches->begin(), matches->end(), &CompareMatchPosition);
+ // WARNING: we don't use iterator here as CoalesceMatchesFrom may remove
+ // from matches.
+ for (size_t i = 0; i < matches->size(); ++i)
+ CoalesceMatchesFrom(i, matches);
+}

Powered by Google App Engine
This is Rietveld 408576698