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

Unified Diff: base/containers/mru_cache.h

Issue 2844443002: Remove warning about std::map::emplace (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | styleguide/c++/c++11.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/containers/mru_cache.h
diff --git a/base/containers/mru_cache.h b/base/containers/mru_cache.h
index 7c684a9690da9b40280f20598edaa88fd71aa6b7..d20ef132b529ecce1032005476f936e05cf708c0 100644
--- a/base/containers/mru_cache.h
+++ b/base/containers/mru_cache.h
@@ -97,8 +97,8 @@ class MRUCacheBase {
ShrinkToSize(max_size_ - 1);
}
- ordering_.push_front(value_type(key, std::forward<Payload>(payload)));
- index_.insert(std::make_pair(key, ordering_.begin()));
+ ordering_.emplace_front(key, std::forward<Payload>(payload));
+ index_.emplace(key, ordering_.begin());
jdoerrie 2017/04/25 11:33:47 While |index_|'s type is a template parameter, it
return ordering_.begin();
}
« no previous file with comments | « no previous file | styleguide/c++/c++11.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698