Upgrade clang-format to version 15 (#6859)

This commit is contained in:
Dennis Luxen
2024-05-06 09:14:46 +02:00
committed by GitHub
parent b503e96a98
commit 7f9d591ab7
156 changed files with 2357 additions and 1894 deletions
+10 -8
View File
@@ -63,14 +63,16 @@ template <typename StringView> inline auto decompose(const StringView &lhs, cons
auto const lcs = longest_common_substring(lhs, rhs);
// trim spaces, transform to lower
const auto trim = [](StringView view) {
const auto trim = [](StringView view)
{
// we compare suffixes based on this value, it might break UTF chars, but as long as we are
// consistent in handling, we do not create bad results
std::string str;
str.reserve(view.size());
std::transform(view.begin(), view.end(), std::back_inserter(str), [](unsigned char c) {
return std::tolower(c);
});
std::transform(view.begin(),
view.end(),
std::back_inserter(str),
[](unsigned char c) { return std::tolower(c); });
auto front = str.find_first_not_of(' ');
if (front == std::string::npos)
@@ -131,13 +133,13 @@ inline bool requiresNameAnnounced(const StringView &from_name,
const auto checkForPrefixOrSuffixChange = [](const std::string_view first,
const std::string_view second,
const SuffixTable &suffix_table) {
const SuffixTable &suffix_table)
{
std::string first_prefix, first_suffix, second_prefix, second_suffix;
std::tie(first_prefix, first_suffix, second_prefix, second_suffix) =
decompose(first, second);
const auto checkTable = [&](const std::string &str) {
return str.empty() || suffix_table.isSuffix(str);
};
const auto checkTable = [&](const std::string &str)
{ return str.empty() || suffix_table.isSuffix(str); };
return checkTable(first_prefix) && checkTable(first_suffix) && checkTable(second_prefix) &&
checkTable(second_suffix);