From 454537d53efd0579d4cd2a48108f3bdb490b08d2 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Fri, 5 Aug 2022 15:39:00 +0200 Subject: Replace BitUtils with C++20: RotateLeft/RotateRight Now that we've flipped the C++20 switch, let's start making use of the nice new header. I'm planning on handling this move away from BitUtils.h incrementally in a series of PRs. There may be a few functions remaining in BitUtils.h by the end that C++20 doesn't have any equivalents for. --- Source/Core/Common/Hash.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'Source/Core/Common/Hash.cpp') diff --git a/Source/Core/Common/Hash.cpp b/Source/Core/Common/Hash.cpp index f11ac4d62c..e6b421e96f 100644 --- a/Source/Core/Common/Hash.cpp +++ b/Source/Core/Common/Hash.cpp @@ -4,7 +4,9 @@ #include "Common/Hash.h" #include +#include #include + #include #include "Common/BitUtils.h" @@ -60,15 +62,15 @@ static u64 getblock(const u64* p, int i) static void bmix64(u64& h1, u64& h2, u64& k1, u64& k2, u64& c1, u64& c2) { k1 *= c1; - k1 = Common::RotateLeft(k1, 23); + k1 = std::rotl(k1, 23); k1 *= c2; h1 ^= k1; h1 += h2; - h2 = Common::RotateLeft(h2, 41); + h2 = std::rotl(h2, 41); k2 *= c2; - k2 = Common::RotateLeft(k2, 23); + k2 = std::rotl(k2, 23); k2 *= c1; h2 ^= k2; h2 += h1; -- cgit v1.2.3