style: adjust clang-format rules (#2186)

Co-authored-by: Vithorio Polten <reach@vithor.io>
This commit is contained in:
ReenigneArcher
2025-01-19 22:34:47 -05:00
committed by GitHub
parent f57aee9025
commit c2420427b1
158 changed files with 8754 additions and 9994 deletions

View File

@@ -4,6 +4,7 @@
*/
#pragma once
// standard includes
#include <random>
/**
@@ -16,8 +17,7 @@ namespace uuid_util {
std::uint32_t b32[4];
std::uint64_t b64[2];
static uuid_t
generate(std::default_random_engine &engine) {
static uuid_t generate(std::default_random_engine &engine) {
std::uniform_int_distribution<std::uint8_t> dist(0, std::numeric_limits<std::uint8_t>::max());
uuid_t buf;
@@ -31,17 +31,15 @@ namespace uuid_util {
return buf;
}
static uuid_t
generate() {
static uuid_t generate() {
std::random_device r;
std::default_random_engine engine { r() };
std::default_random_engine engine {r()};
return generate(engine);
}
[[nodiscard]] std::string
string() const {
[[nodiscard]] std::string string() const {
std::string result;
result.reserve(sizeof(uuid_t) * 2 + 4);
@@ -68,18 +66,15 @@ namespace uuid_util {
return result;
}
constexpr bool
operator==(const uuid_t &other) const {
constexpr bool operator==(const uuid_t &other) const {
return b64[0] == other.b64[0] && b64[1] == other.b64[1];
}
constexpr bool
operator<(const uuid_t &other) const {
constexpr bool operator<(const uuid_t &other) const {
return (b64[0] < other.b64[0] || (b64[0] == other.b64[0] && b64[1] < other.b64[1]));
}
constexpr bool
operator>(const uuid_t &other) const {
constexpr bool operator>(const uuid_t &other) const {
return (b64[0] > other.b64[0] || (b64[0] == other.b64[0] && b64[1] > other.b64[1]));
}
};