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

Unified Diff: base/id_map.h

Issue 2830093003: Replace uses of hash_map in //base (Closed)
Patch Set: iOS 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 | « base/files/file_path_watcher_linux.cc ('k') | base/id_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/id_map.h
diff --git a/base/id_map.h b/base/id_map.h
index d171fb14c102cefc5b5ec332315e8a7303f86b9c..8586222b887ddc8037571982c3a7656ff7dcd76c 100644
--- a/base/id_map.h
+++ b/base/id_map.h
@@ -7,12 +7,14 @@
#include <stddef.h>
#include <stdint.h>
+
#include <memory>
#include <set>
#include <type_traits>
+#include <unordered_map>
#include <utility>
-#include "base/containers/hash_tables.h"
+#include "base/containers/flat_set.h"
#include "base/logging.h"
#include "base/macros.h"
#include "base/sequence_checker.h"
@@ -35,7 +37,8 @@ class IDMap final {
private:
using T = typename std::remove_reference<decltype(*V())>::type;
- using HashTable = base::hash_map<KeyType, V>;
+
+ using HashTable = std::unordered_map<KeyType, V>;
public:
IDMap() : iteration_depth_(0), next_id_(1), check_on_null_data_(false) {
@@ -236,7 +239,7 @@ class IDMap final {
// Keep set of IDs that should be removed after the outermost iteration has
// finished. This way we manage to not invalidate the iterator when an element
// is removed.
- std::set<KeyType> removed_ids_;
+ base::flat_set<KeyType> removed_ids_;
// The next ID that we will return from Add()
KeyType next_id_;
« no previous file with comments | « base/files/file_path_watcher_linux.cc ('k') | base/id_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698