aboutsummaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorMorph <39850852+Morph1984@users.noreply.github.com>2022-02-10 15:03:49 -0500
committerMorph <39850852+Morph1984@users.noreply.github.com>2022-02-10 15:03:49 -0500
commit9429bb6222ae6285c9cd878021c699315ed1cf0f (patch)
tree757ae4c22d01cc08dc5b04400215b957ac0fb8cb /src/common
parent2d8d60bf9b7110e476f105ddfe1185f2c1645d57 (diff)
common: uuid: Use sizeof(u64) instead of 8 in Hash()
Diffstat (limited to 'src/common')
-rw-r--r--src/common/uuid.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/uuid.cpp b/src/common/uuid.cpp
index 4aab10e087..2b6a530e39 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 {