mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-25 22:57:22 +00:00
common: uuid: Use sizeof(u64) instead of 8 in Hash()
This commit is contained in:
parent
ec4d7f71fe
commit
3799c820ca
1 changed files with 5 additions and 5 deletions
|
@ -160,13 +160,13 @@ std::string UUID::FormattedString() const {
|
||||||
}
|
}
|
||||||
|
|
||||||
size_t UUID::Hash() const noexcept {
|
size_t UUID::Hash() const noexcept {
|
||||||
u64 hash;
|
u64 upper_hash;
|
||||||
u64 temp;
|
u64 lower_hash;
|
||||||
|
|
||||||
std::memcpy(&hash, uuid.data(), sizeof(u64));
|
std::memcpy(&upper_hash, uuid.data(), sizeof(u64));
|
||||||
std::memcpy(&temp, uuid.data() + 8, 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 {
|
u128 UUID::AsU128() const {
|
||||||
|
|
Loading…
Reference in a new issue