summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorGravatar Lioncash2021-09-22 17:52:37 -0400
committerGravatar Lioncash2021-09-22 17:59:00 -0400
commit40314cc58646e9e91e961e0d82b7d1b53bd839a0 (patch)
tree17ec58af41507fc0edff29325b528ac4029d599b /src/common
parentMerge pull request #7003 from ameerj/unlocked-present-mode (diff)
downloadyuzu-40314cc58646e9e91e961e0d82b7d1b53bd839a0.tar.gz
yuzu-40314cc58646e9e91e961e0d82b7d1b53bd839a0.tar.xz
yuzu-40314cc58646e9e91e961e0d82b7d1b53bd839a0.zip
common/uuid: Add validity checking functions to interface
Given we have a function to invalidate, we should also have ones to query the validity. Also makes the code more straightforward to read.
Diffstat (limited to 'src/common')
-rw-r--r--src/common/uuid.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h
index 2353179d8..8ea01f8da 100644
--- a/src/common/uuid.h
+++ b/src/common/uuid.h
@@ -58,6 +58,13 @@ struct UUID {
58 uuid = INVALID_UUID; 58 uuid = INVALID_UUID;
59 } 59 }
60 60
61 [[nodiscard]] constexpr bool IsInvalid() const {
62 return uuid == INVALID_UUID;
63 }
64 [[nodiscard]] constexpr bool IsValid() const {
65 return !IsInvalid();
66 }
67
61 // TODO(ogniK): Properly generate a Nintendo ID 68 // TODO(ogniK): Properly generate a Nintendo ID
62 [[nodiscard]] constexpr u64 GetNintendoID() const { 69 [[nodiscard]] constexpr u64 GetNintendoID() const {
63 return uuid[0]; 70 return uuid[0];