From faf088bebd0b1de4bcbdf9a2ed6bd754f2a418ac Mon Sep 17 00:00:00 2001 From: Crashoz Date: Wed, 3 Mar 2021 13:24:53 +0100 Subject: [PATCH] Fix #2 fixed less or equal operator on UUIDs --- uuid_v4.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uuid_v4.h b/uuid_v4.h index cd6cd81..2986ebb 100644 --- a/uuid_v4.h +++ b/uuid_v4.h @@ -165,7 +165,7 @@ class UUID { // It's faster to compare two uint64_t uint64_t *x = (uint64_t*)lhs.data; uint64_t *y = (uint64_t*)rhs.data; - return *x < *y || *(x+1) < *(y+1); + return *x < *y || (*x == *y && *(x + 1) < *(y + 1)); } friend bool operator!=(const UUID &lhs, const UUID &rhs) { return !(lhs == rhs); }