summaryrefslogtreecommitdiff
path: root/libartbase/base/hash_map.h
diff options
context:
space:
mode:
author Vladimir Marko <vmarko@google.com> 2018-06-20 14:30:08 +0100
committer Vladimir Marko <vmarko@google.com> 2018-06-21 13:46:50 +0100
commit54159c6c6fe529a55ef3d15a3c8418362d5a43fb (patch)
tree2ec461de8ec15383134f4c6e209f4b8a33854277 /libartbase/base/hash_map.h
parent44217b253bf4e5990de7051129ecda34f94d7f25 (diff)
Use HashSet<std::string> instead of unordered_set<>.
Change the default parameters for HashSet<std::string> to allow passing StringPiece as a key, avoiding an unnecessary allocation. Use the HashSet<std::string> instead of std::unordered_set<std::string>. Rename HashSet<> functions that mirror std::unordered_multiset<> to lower-case. Fix CompilerDriver::LoadImageClasses() to avoid using invalidated iterator. Test: m test-art-host-gtest Test: testrunner.py --host Change-Id: I7f8b82ee0b07befc5a0ee1c420b08a2068ad931e
Diffstat (limited to 'libartbase/base/hash_map.h')
-rw-r--r--libartbase/base/hash_map.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/libartbase/base/hash_map.h b/libartbase/base/hash_map.h
index 0d7198c0f7..a3bb5b5550 100644
--- a/libartbase/base/hash_map.h
+++ b/libartbase/base/hash_map.h
@@ -48,9 +48,12 @@ class HashMapWrapper {
Fn fn_;
};
-template <class Key, class Value, class EmptyFn,
- class HashFn = std::hash<Key>, class Pred = std::equal_to<Key>,
- class Alloc = std::allocator<std::pair<Key, Value>>>
+template <class Key,
+ class Value,
+ class EmptyFn,
+ class HashFn = DefaultHashFn<Key>,
+ class Pred = DefaultPred<Key>,
+ class Alloc = std::allocator<std::pair<Key, Value>>>
class HashMap : public HashSet<std::pair<Key, Value>,
EmptyFn,
HashMapWrapper<HashFn>,