tint/utils: Reduce cost of HashCombine

Do less shufflin' for faster hashin'

Change-Id: Ieb6bd960aee4e7a351f4f87249cde96606f835e0
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/110561
Reviewed-by: Antonio Maiorano <amaiorano@google.com>
Kokoro: Kokoro <noreply+kokoro@google.com>
Commit-Queue: Ben Clayton <bclayton@google.com>
This commit is contained in:
Ben Clayton 2022-12-13 16:53:31 +00:00 committed by Dawn LUCI CQ
parent be96967778
commit 51d88ebf30
1 changed files with 1 additions and 1 deletions

View File

@ -164,7 +164,7 @@ size_t Hash(const ARGS&... args) {
template <typename... ARGS>
size_t HashCombine(size_t hash, const ARGS&... values) {
constexpr size_t offset = detail::HashCombineOffset<sizeof(size_t)>::value();
((hash ^= Hash(values) + offset + (hash << 6) + (hash >> 2)), ...);
((hash ^= Hash(values) + (offset ^ (hash >> 2))), ...);
return hash;
}