| Index: components/omnibox/browser/url_index_private_data.cc
|
| diff --git a/components/omnibox/browser/url_index_private_data.cc b/components/omnibox/browser/url_index_private_data.cc
|
| index b9f2a93ea945bc2e73e33afdb396d0bd0ef8a975..2671573ba1e12cba45be7267fd7f4a6bdfeed7a7 100644
|
| --- a/components/omnibox/browser/url_index_private_data.cc
|
| +++ b/components/omnibox/browser/url_index_private_data.cc
|
| @@ -590,6 +590,15 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm(
|
| // the sets from each word.
|
| // We use |buffer| because it's more efficient to collect everything and then
|
| // construct a flat_set than to insert elements one by one.
|
| +
|
| +#define BUFFER 1
|
| +#define BY_ONE 2
|
| +#define MERGE 3
|
| +
|
| +#define METHOD MERGE
|
| +
|
| +#if METHOD == BUFFER
|
| +
|
| HistoryIDVector buffer;
|
| for (WordID word_id : word_id_set) {
|
| WordIDHistoryMap::iterator word_iter = word_id_history_map_.find(word_id);
|
| @@ -602,6 +611,34 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm(
|
| HistoryIDSet history_id_set(buffer.begin(), buffer.end(),
|
| base::KEEP_FIRST_OF_DUPES);
|
|
|
| +#elif METHOD == BY_ONE
|
| +
|
| + HistoryIDSet history_id_set;
|
| +
|
| + for (WordID word_id : word_id_set) {
|
| + WordIDHistoryMap::iterator word_iter = word_id_history_map_.find(word_id);
|
| + if (word_iter != word_id_history_map_.end()) {
|
| + HistoryIDSet& word_history_id_set(word_iter->second);
|
| + history_id_set.insert_by_one(word_history_id_set.begin(),
|
| + word_history_id_set.end());
|
| + }
|
| + }
|
| +
|
| +#else // MERGE
|
| +
|
| + HistoryIDSet history_id_set;
|
| +
|
| + for (WordID word_id : word_id_set) {
|
| + WordIDHistoryMap::iterator word_iter = word_id_history_map_.find(word_id);
|
| + if (word_iter != word_id_history_map_.end()) {
|
| + HistoryIDSet& word_history_id_set(word_iter->second);
|
| + history_id_set.insert_merge(word_history_id_set.begin(),
|
| + word_history_id_set.end());
|
| + }
|
| + }
|
| +
|
| +#endif
|
| +
|
| // Record a new cache entry for this word if the term is longer than
|
| // a single character.
|
| if (term_length > 1)
|
|
|