From 12aacc28360a665554c5939fedb2bbe772f0ecfb Mon Sep 17 00:00:00 2001 From: sunmy <7743179+sun_mengyue@user.noreply.gitee.com> Date: Tue, 8 Jun 2021 08:50:17 +0800 Subject: [PATCH] add string length to avoid strlen call --- include/fmt/chrono.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index 11b9999e..924bfaff 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -452,10 +452,10 @@ template struct formatter, Char> : formatter { FMT_CONSTEXPR FMT_INLINE void generate_defalut_spec(char) { - this->specs = "%Y-%m-%d %H:%M:%S"; + this->specs = {"%Y-%m-%d %H:%M:%S", 17}; } FMT_CONSTEXPR FMT_INLINE void generate_defalut_spec(wchar_t) { - this->specs = L"%Y-%m-%d %H:%M:%S"; + this->specs = {L"%Y-%m-%d %H:%M:%S", 17}; } template