diff options
author | 2018-06-20 14:30:08 +0100 | |
---|---|---|
committer | 2018-06-21 13:46:50 +0100 | |
commit | 54159c6c6fe529a55ef3d15a3c8418362d5a43fb (patch) | |
tree | 2ec461de8ec15383134f4c6e209f4b8a33854277 /libartbase/base/utils.h | |
parent | 44217b253bf4e5990de7051129ecda34f94d7f25 (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/utils.h')
-rw-r--r-- | libartbase/base/utils.h | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/libartbase/base/utils.h b/libartbase/base/utils.h index 73c1c226f9..6e3b78e12c 100644 --- a/libartbase/base/utils.h +++ b/libartbase/base/utils.h @@ -244,20 +244,6 @@ static inline void CheckedCall(const Func& function, const char* what, Args... a } } -// Hash bytes using a relatively fast hash. -static inline size_t HashBytes(const uint8_t* data, size_t len) { - size_t hash = 0x811c9dc5; - for (uint32_t i = 0; i < len; ++i) { - hash = (hash * 16777619) ^ data[i]; - } - hash += hash << 13; - hash ^= hash >> 7; - hash += hash << 3; - hash ^= hash >> 17; - hash += hash << 5; - return hash; -} - } // namespace art #endif // ART_LIBARTBASE_BASE_UTILS_H_ |