More elegant formulation

This commit is contained in:
Heiko Lewin
2024-04-08 16:02:16 +02:00
parent 0b33c92c9b
commit 1146f76bde
+1 -4
View File
@@ -52,10 +52,7 @@ consteval auto get_field_name_str_view() {
#endif
#if defined(__clang__)
const auto split = func_name.substr(0, func_name.size() - 2);
const auto possibly_prefixed = split.substr(split.find_last_of(".") + 1);
const auto separator_index = possibly_prefixed.find_last_of(":");
if (separator_index == std::string_view::npos) return possibly_prefixed;
return possibly_prefixed.substr(separator_index + 1);
return split.substr(split.find_last_of(":.") + 1);
#elif defined(__GNUC__)
const auto split = func_name.substr(0, func_name.size() - 2);
return split.substr(split.find_last_of(":") + 1);