diff options
| author | 2022-02-10 15:03:49 -0500 | |
|---|---|---|
| committer | 2022-02-10 15:03:49 -0500 | |
| commit | 3799c820ca7c5b978d47be9c5ac1318333e5d9cb (patch) | |
| tree | 757ae4c22d01cc08dc5b04400215b957ac0fb8cb /src/common/uuid.cpp | |
| parent | common: uuid: Return an invalid UUID if conversion from string fails (diff) | |
| download | yuzu-3799c820ca7c5b978d47be9c5ac1318333e5d9cb.tar.gz yuzu-3799c820ca7c5b978d47be9c5ac1318333e5d9cb.tar.xz yuzu-3799c820ca7c5b978d47be9c5ac1318333e5d9cb.zip | |
common: uuid: Use sizeof(u64) instead of 8 in Hash()
Diffstat (limited to '')
| -rw-r--r-- | src/common/uuid.cpp | 10 |
1 files 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 { | |||
| 160 | } | 160 | } |
| 161 | 161 | ||
| 162 | size_t UUID::Hash() const noexcept { | 162 | size_t UUID::Hash() const noexcept { |
| 163 | u64 hash; | 163 | u64 upper_hash; |
| 164 | u64 temp; | 164 | u64 lower_hash; |
| 165 | 165 | ||
| 166 | std::memcpy(&hash, uuid.data(), sizeof(u64)); | 166 | std::memcpy(&upper_hash, uuid.data(), sizeof(u64)); |
| 167 | std::memcpy(&temp, uuid.data() + 8, sizeof(u64)); | 167 | std::memcpy(&lower_hash, uuid.data() + sizeof(u64), sizeof(u64)); |
| 168 | 168 | ||
| 169 | return hash ^ std::rotl(temp, 1); | 169 | return upper_hash ^ std::rotl(lower_hash, 1); |
| 170 | } | 170 | } |
| 171 | 171 | ||
| 172 | u128 UUID::AsU128() const { | 172 | u128 UUID::AsU128() const { |