From a9b3aa03e0e1e5d0fee6f2086fa82919a47b03d3 Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Sat, 5 Oct 2024 00:51:28 +0500 Subject: [PATCH] Simplify fstring Signed-off-by: Vladislav Shchapov --- include/fmt/base.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/fmt/base.h b/include/fmt/base.h index 2144417673bf..fddde6434c19 100644 --- a/include/fmt/base.h +++ b/include/fmt/base.h @@ -2652,7 +2652,7 @@ template struct fstring { static_assert(count<(std::is_base_of>::value && std::is_reference::value)...>() == 0, "passing views as lvalues is disallowed"); - if (FMT_USE_CONSTEVAL) parse_format_string(s, checker(s, arg_pack())); + if (FMT_USE_CONSTEVAL) parse_format_string(str, checker(str, arg_pack())); #ifdef FMT_ENFORCE_COMPILE_STRING static_assert( FMT_USE_CONSTEVAL && sizeof(s) != 0, @@ -2662,9 +2662,8 @@ template struct fstring { template ::value)> FMT_CONSTEVAL FMT_ALWAYS_INLINE fstring(const S& s) : str(s) { - auto sv = string_view(str); if (FMT_USE_CONSTEVAL) - detail::parse_format_string(sv, checker(sv, arg_pack())); + detail::parse_format_string(str, checker(str, arg_pack())); #ifdef FMT_ENFORCE_COMPILE_STRING static_assert( FMT_USE_CONSTEVAL && sizeof(s) != 0,