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

Unified Diff: components/omnibox/browser/url_index_private_data.cc

Issue 2333253002: flat containers prototype (Closed)
Patch Set: using flat maps/sets to optimise Created 4 years, 3 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
« no previous file with comments | « components/omnibox/browser/url_index_private_data.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 6ca56db8c245fcce787c720aeaa98eb36e788d4b..6caab4b391cc55bfb73f005f85a0d4ad01efc68c 100644
--- a/components/omnibox/browser/url_index_private_data.cc
+++ b/components/omnibox/browser/url_index_private_data.cc
@@ -278,7 +278,7 @@ ScoredHistoryMatches URLIndexPrivateData::HistoryItemsForTerms(
for (SearchTermCacheMap::iterator cache_iter = search_term_cache_.begin();
cache_iter != search_term_cache_.end(); ) {
if (!cache_iter->second.used_)
- search_term_cache_.erase(cache_iter++);
+ cache_iter = search_term_cache_.erase(cache_iter);
else
++cache_iter;
}
@@ -630,7 +630,7 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm(
for (WordIDSet::iterator word_set_iter = word_id_set.begin();
word_set_iter != word_id_set.end(); ) {
if (word_list_[*word_set_iter].find(term) == base::string16::npos)
- word_id_set.erase(word_set_iter++);
+ word_set_iter = word_id_set.erase(word_set_iter);
else
++word_set_iter;
}
@@ -642,14 +642,15 @@ HistoryIDSet URLIndexPrivateData::HistoryIDsForTerm(
// the sets from each word.
HistoryIDSet history_id_set;
if (!word_id_set.empty()) {
+ auto unsafe = history_id_set.unsafe_access();
dyaroshev 2016/09/13 12:28:13 Here is the tight spot I was talking about in chro
for (WordIDSet::iterator word_id_iter = word_id_set.begin();
word_id_iter != word_id_set.end(); ++word_id_iter) {
WordID word_id = *word_id_iter;
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(word_history_id_set.begin(),
- word_history_id_set.end());
+ unsafe->insert(unsafe->end(), word_history_id_set.begin(),
+ word_history_id_set.end());
}
}
}
« no previous file with comments | « components/omnibox/browser/url_index_private_data.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698