From 54159c6c6fe529a55ef3d15a3c8418362d5a43fb Mon Sep 17 00:00:00 2001 From: Vladimir Marko Date: Wed, 20 Jun 2018 14:30:08 +0100 Subject: Use HashSet instead of unordered_set<>. Change the default parameters for HashSet to allow passing StringPiece as a key, avoiding an unnecessary allocation. Use the HashSet instead of std::unordered_set. 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 --- libartbase/base/utils.h | 14 -------------- 1 file changed, 14 deletions(-) (limited to 'libartbase/base/utils.h') 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_ -- cgit v1.2.3-59-g8ed1b