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:
parent
be96967778
commit
51d88ebf30
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue