From c627c665603232e5c53bf97e4db7592ec67decf7 Mon Sep 17 00:00:00 2001 From: gabime Date: Mon, 31 Oct 2022 18:26:07 +0200 Subject: [PATCH] Replace fmt::detail::vformat_to(buf,..) with fmt::vformat_to(fmt::appender(buf) --- include/spdlog/logger.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/include/spdlog/logger.h b/include/spdlog/logger.h index 068b5aa6..8f83e81b 100644 --- a/include/spdlog/logger.h +++ b/include/spdlog/logger.h @@ -371,8 +371,7 @@ protected: #ifdef SPDLOG_USE_STD_FORMAT fmt_lib::vformat_to(std::back_inserter(buf), fmt, fmt_lib::make_format_args(std::forward(args)...)); #else - // seems that fmt::detail::vformat_to(buf, ...) is ~20ns faster than fmt::vformat_to(std::back_inserter(buf),..) - fmt::detail::vformat_to(buf, fmt, fmt::make_format_args(std::forward(args)...)); + fmt::vformat_to(fmt::appender(buf), fmt, fmt::make_format_args(std::forward(args)...)); #endif details::log_msg log_msg(loc, name_, lvl, string_view_t(buf.data(), buf.size()));