Skip to content

Commit 9142dfe

Browse files
Use explicit casting in cuckoocache's compute_hashes(...) to clarify integer conversion
1 parent 0a01843 commit 9142dfe

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/cuckoocache.h

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -242,14 +242,14 @@ class cache
242242
*/
243243
inline std::array<uint32_t, 8> compute_hashes(const Element& e) const
244244
{
245-
return {{(uint32_t)((hash_function.template operator()<0>(e) * (uint64_t)size) >> 32),
246-
(uint32_t)((hash_function.template operator()<1>(e) * (uint64_t)size) >> 32),
247-
(uint32_t)((hash_function.template operator()<2>(e) * (uint64_t)size) >> 32),
248-
(uint32_t)((hash_function.template operator()<3>(e) * (uint64_t)size) >> 32),
249-
(uint32_t)((hash_function.template operator()<4>(e) * (uint64_t)size) >> 32),
250-
(uint32_t)((hash_function.template operator()<5>(e) * (uint64_t)size) >> 32),
251-
(uint32_t)((hash_function.template operator()<6>(e) * (uint64_t)size) >> 32),
252-
(uint32_t)((hash_function.template operator()<7>(e) * (uint64_t)size) >> 32)}};
245+
return {{(uint32_t)(((uint64_t)hash_function.template operator()<0>(e) * (uint64_t)size) >> 32),
246+
(uint32_t)(((uint64_t)hash_function.template operator()<1>(e) * (uint64_t)size) >> 32),
247+
(uint32_t)(((uint64_t)hash_function.template operator()<2>(e) * (uint64_t)size) >> 32),
248+
(uint32_t)(((uint64_t)hash_function.template operator()<3>(e) * (uint64_t)size) >> 32),
249+
(uint32_t)(((uint64_t)hash_function.template operator()<4>(e) * (uint64_t)size) >> 32),
250+
(uint32_t)(((uint64_t)hash_function.template operator()<5>(e) * (uint64_t)size) >> 32),
251+
(uint32_t)(((uint64_t)hash_function.template operator()<6>(e) * (uint64_t)size) >> 32),
252+
(uint32_t)(((uint64_t)hash_function.template operator()<7>(e) * (uint64_t)size) >> 32)}};
253253
}
254254

255255
/* end

0 commit comments

Comments
 (0)