mirror of
https://github.com/transmission/transmission
synced 2025-02-20 21:26:53 +00:00
refactor: quark's static_assert formatting (#2489)
Slight refactor to libt/quark's static asserts so that the codebase formats the same between clang-format 12, 13, and 14.
This commit is contained in:
parent
43bd736eb4
commit
2329f7541f
1 changed files with 9 additions and 10 deletions
|
@ -409,21 +409,20 @@ auto constexpr my_static = std::array<std::string_view, 390>{ ""sv,
|
|||
"webseeds"sv,
|
||||
"webseedsSendingToUs"sv };
|
||||
|
||||
size_t constexpr quarks_are_sorted = ( //
|
||||
[]() constexpr
|
||||
bool constexpr quarks_are_sorted()
|
||||
{
|
||||
for (size_t i = 1; i < std::size(my_static); ++i)
|
||||
{
|
||||
for (size_t i = 1; i < std::size(my_static); ++i)
|
||||
if (my_static[i - 1] >= my_static[i])
|
||||
{
|
||||
if (my_static[i - 1] >= my_static[i])
|
||||
{
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
})();
|
||||
return true;
|
||||
}
|
||||
|
||||
static_assert(quarks_are_sorted, "Predefined quarks must be sorted by their string value");
|
||||
static_assert(quarks_are_sorted(), "Predefined quarks must be sorted by their string value");
|
||||
static_assert(std::size(my_static) == TR_N_KEYS);
|
||||
|
||||
auto& my_runtime{ *new std::vector<std::string_view>{} };
|
||||
|
|
Loading…
Reference in a new issue