summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-20 17:27:48 -0400
committerGravatar Lioncash2018-08-20 19:48:57 -0400
commit69dd37d874094a2ad632e5dbafaa16553703af73 (patch)
tree8290bb073898ea80d62459dc2cd632091fd7b4fc /src/core
parentprofile_manager: Move UUID generation function to the cpp file (diff)
downloadyuzu-69dd37d874094a2ad632e5dbafaa16553703af73.tar.gz
yuzu-69dd37d874094a2ad632e5dbafaa16553703af73.tar.xz
yuzu-69dd37d874094a2ad632e5dbafaa16553703af73.zip
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.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/acc/profile_manager.h10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/core/hle/service/acc/profile_manager.h b/src/core/hle/service/acc/profile_manager.h
index 91f6f03a9..054dd864e 100644
--- a/src/core/hle/service/acc/profile_manager.h
+++ b/src/core/hle/service/acc/profile_manager.h
@@ -21,16 +21,14 @@ struct UUID {
21 u128 uuid = INVALID_UUID; 21 u128 uuid = INVALID_UUID;
22 UUID() = default; 22 UUID() = default;
23 explicit UUID(const u128& id) : uuid{id} {} 23 explicit UUID(const u128& id) : uuid{id} {}
24 explicit UUID(const u64 lo, const u64 hi) { 24 explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {}
25 uuid[0] = lo; 25
26 uuid[1] = hi;
27 };
28 explicit operator bool() const { 26 explicit operator bool() const {
29 return uuid[0] != INVALID_UUID[0] || uuid[1] != INVALID_UUID[1]; 27 return uuid != INVALID_UUID;
30 } 28 }
31 29
32 bool operator==(const UUID& rhs) const { 30 bool operator==(const UUID& rhs) const {
33 return std::tie(uuid[0], uuid[1]) == std::tie(rhs.uuid[0], rhs.uuid[1]); 31 return uuid == rhs.uuid;
34 } 32 }
35 33
36 bool operator!=(const UUID& rhs) const { 34 bool operator!=(const UUID& rhs) const {