mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +02:00
put custom hashing for UUID in UUIDHasher
This commit is contained in:
parent
abf07dc06d
commit
d9f445d5f6
3 changed files with 8 additions and 10 deletions
|
@ -81,7 +81,7 @@ private:
|
|||
AvatarData _avatar;
|
||||
|
||||
uint16_t _lastReceivedSequenceNumber { 0 };
|
||||
std::unordered_map<QUuid, uint16_t, UUIDHasher> _lastBroadcastSequenceNumbers;
|
||||
std::unordered_map<QUuid, uint16_t> _lastBroadcastSequenceNumbers;
|
||||
|
||||
bool _hasReceivedFirstPackets = false;
|
||||
quint64 _billboardChangeTimestamp = 0;
|
||||
|
|
|
@ -18,10 +18,4 @@ const int NUM_BYTES_RFC4122_UUID = 16;
|
|||
|
||||
QString uuidStringWithoutCurlyBraces(const QUuid& uuid);
|
||||
|
||||
template <> struct std::hash<QUuid> {
|
||||
size_t operator()(const QUuid& uuid) const {
|
||||
return qHash(uuid);
|
||||
}
|
||||
};
|
||||
|
||||
#endif // hifi_UUID_h
|
||||
|
|
|
@ -20,9 +20,13 @@
|
|||
class UUIDHasher {
|
||||
public:
|
||||
size_t operator()(const QUuid& uuid) const {
|
||||
return uuid.data1 ^ uuid.data2 ^ (uuid.data3 << 16)
|
||||
^ ((uuid.data4[0] << 24) | (uuid.data4[1] << 16) | (uuid.data4[2] << 8) | uuid.data4[3])
|
||||
^ ((uuid.data4[4] << 24) | (uuid.data4[5] << 16) | (uuid.data4[6] << 8) | uuid.data4[7]);
|
||||
return qHash(uuid);
|
||||
}
|
||||
};
|
||||
|
||||
template <> struct std::hash<QUuid> {
|
||||
size_t operator()(const QUuid& uuid) const {
|
||||
return qHash(uuid);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue