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..7967611b054a9412886ac90d1069f4f2f74546bf 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 == '"' || |
@@ -391,7 +381,7 @@ bool QueryParser::DoesQueryMatch(const base::string16& text, |
// completely punt here. |
match_positions->clear(); |
} else { |
- CoalseAndSortMatchPositions(&matches); |
+ CoalesceAndSortMatchPositions(&matches); |
match_positions->swap(matches); |
} |
return true; |
@@ -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::CoalesceAndSortMatchPositions( |
+ 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); |
+} |