diff options
| author | Morph <39850852+Morph1984@users.noreply.github.com> | 2021-07-20 13:44:48 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-20 13:44:48 -0400 |
| commit | eee7653871f1e0a14fb94155c5ceeaa366d54db3 (patch) | |
| tree | 82c6645ae73a667245b7f2444b46fd3197b55b3c /src | |
| parent | 805f1888da2608efc8111c426e0cceda49a8756b (diff) | |
| parent | 7ce462a1f76b68756a0a0fcd222d8ebc95643392 (diff) | |
Merge pull request #6684 from ogniK5377/uuid-cpp20-new
uuid: Directly compare UUID instead of checking per element
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/uuid.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/common/uuid.h b/src/common/uuid.h index 2e7a184059..0ffa37e7cb 100644 --- a/src/common/uuid.h +++ b/src/common/uuid.h @@ -20,12 +20,11 @@ struct UUID { constexpr explicit UUID(const u64 lo, const u64 hi) : uuid{{lo, hi}} {} [[nodiscard]] constexpr explicit operator bool() const { - return uuid[0] != INVALID_UUID[0] && uuid[1] != INVALID_UUID[1]; + return uuid != INVALID_UUID; } [[nodiscard]] constexpr bool operator==(const UUID& rhs) const { - // TODO(DarkLordZach): Replace with uuid == rhs.uuid with C++20 - return uuid[0] == rhs.uuid[0] && uuid[1] == rhs.uuid[1]; + return uuid == rhs.uuid; } [[nodiscard]] constexpr bool operator!=(const UUID& rhs) const { |
