From 3799c820ca7c5b978d47be9c5ac1318333e5d9cb Mon Sep 17 00:00:00 2001 From: Morph <39850852+Morph1984@users.noreply.github.com> Date: Thu, 10 Feb 2022 15:03:49 -0500 Subject: [PATCH] common: uuid: Use sizeof(u64) instead of 8 in Hash() --- src/common/uuid.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp index 4aab10e08..2b6a530e3 100644 --- a/src/common/uuid.cpp +++ b/src/common/uuid.cpp @@ -160,13 +160,13 @@ std::string UUID::FormattedString() const { } size_t UUID::Hash() const noexcept { - u64 hash; - u64 temp; + u64 upper_hash; + u64 lower_hash; - std::memcpy(&hash, uuid.data(), sizeof(u64)); - std::memcpy(&temp, uuid.data() + 8, sizeof(u64)); + std::memcpy(&upper_hash, uuid.data(), sizeof(u64)); + std::memcpy(&lower_hash, uuid.data() + sizeof(u64), sizeof(u64)); - return hash ^ std::rotl(temp, 1); + return upper_hash ^ std::rotl(lower_hash, 1); } u128 UUID::AsU128() const {