mirror of
https://github.com/starr-dusT/yuzu-mainline
synced 2024-03-05 21:12:25 -08:00
profile_manager: Simplify UUID's two param constructor, operator==, and operator bool
We can use the constructor initializer list and just compare the contained u128's together instead of comparing each element individually. Ditto for comparing against an invalid UUID.
This commit is contained in:
parent
f13a66b963
commit
69dd37d874
@ -21,16 +21,14 @@ struct UUID {
|
|||||||
u128 uuid = INVALID_UUID;
|
u128 uuid = INVALID_UUID;
|
||||||
UUID() = default;
|
UUID() = default;
|
||||||
explicit UUID(const u128& id) : uuid{id} {}
|
explicit UUID(const u128& id) : uuid{id} {}
|
||||||
explicit UUID(const u64 lo, const u64 hi) {
|
explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {}
|
||||||
uuid[0] = lo;
|
|
||||||
uuid[1] = hi;
|
|
||||||
};
|
|
||||||
explicit operator bool() const {
|
explicit operator bool() const {
|
||||||
return uuid[0] != INVALID_UUID[0] || uuid[1] != INVALID_UUID[1];
|
return uuid != INVALID_UUID;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const UUID& rhs) const {
|
bool operator==(const UUID& rhs) const {
|
||||||
return std::tie(uuid[0], uuid[1]) == std::tie(rhs.uuid[0], rhs.uuid[1]);
|
return uuid == rhs.uuid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator!=(const UUID& rhs) const {
|
bool operator!=(const UUID& rhs) const {
|
||||||
|
Loading…
Reference in New Issue
Block a user