Index: components/bookmarks/browser/bookmark_index.h |
diff --git a/components/bookmarks/browser/bookmark_index.h b/components/bookmarks/browser/bookmark_index.h |
index e3d8dd50070ea59218f44b5c35bc049ec8a5d335..619d6c233e33734baf10943c0030a65165fcbc75 100644 |
--- a/components/bookmarks/browser/bookmark_index.h |
+++ b/components/bookmarks/browser/bookmark_index.h |
@@ -53,12 +53,10 @@ class BookmarkIndex { |
typedef std::set<const BookmarkNode*> NodeSet; |
typedef std::map<base::string16, NodeSet> Index; |
- struct Match; |
- typedef std::vector<Match> Matches; |
- |
- // Extracts |matches.nodes| into Nodes, sorts the pairs in decreasing order of |
- // typed count (if supported by the client), and then de-dupes the matches. |
- void SortMatches(const Matches& matches, Nodes* sorted_nodes) const; |
+ // Constructs |sorted_nodes| by taking the matches in |matches| and sorting |
+ // them in decreasing order of typed count (if supported by the client) and |
+ // deduping. |
+ void SortMatches(const NodeSet& matches, Nodes* sorted_nodes) const; |
// Add |node| to |results| if the node matches the query. |
void AddMatchToResults( |
@@ -74,28 +72,12 @@ class BookmarkIndex { |
const base::string16& term, |
bool first_term, |
query_parser::MatchingAlgorithm matching_algorithm, |
- Matches* matches); |
- |
- // Iterates over |matches| updating each Match's nodes to contain the |
- // intersection of the Match's current nodes and the nodes at |index_i|. |
- // If the intersection is empty, the Match is removed. |
- // |
- // This is invoked from GetBookmarksMatchingTerm. |
- void CombineMatchesInPlace(const Index::const_iterator& index_i, |
- Matches* matches); |
- |
- // Iterates over |current_matches| calculating the intersection between the |
- // Match's nodes and the nodes at |index_i|. If the intersection between the |
- // two is non-empty, a new match is added to |result|. |
- // |
- // This differs from CombineMatchesInPlace in that if the intersection is |
- // non-empty the result is added to result, not combined in place. This |
- // variant is used for prefix matching. |
- // |
- // This is invoked from GetBookmarksMatchingTerm. |
- void CombineMatches(const Index::const_iterator& index_i, |
- const Matches& current_matches, |
- Matches* result); |
+ NodeSet* matches); |
+ |
+ // Replaces |*matches| with the intersection of |*matches| and |
+ // |matches_to_incorporate|. |
+ void CombineMatchesInPlace(const NodeSet& matches_to_incorporate, |
+ NodeSet* matches); |
// Returns the set of query words from |query|. |
std::vector<base::string16> ExtractQueryWords(const base::string16& query); |