From 5a8b7cd742066bbb6baf9ca476a860b5b1026d25 Mon Sep 17 00:00:00 2001 From: Vladislav Shchapov Date: Sat, 30 Jul 2022 11:47:33 +0500 Subject: [PATCH] Add comment Signed-off-by: Vladislav Shchapov --- include/fmt/chrono.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/fmt/chrono.h b/include/fmt/chrono.h index aef8fcc1..0e5382b3 100644 --- a/include/fmt/chrono.h +++ b/include/fmt/chrono.h @@ -2028,6 +2028,7 @@ template struct formatter { template FMT_CONSTEXPR auto do_parse(It begin, It end) -> It { if (begin != end && *begin == ':') ++begin; end = detail::parse_chrono_format(begin, end, detail::tm_format_checker()); + // Replace default spec only if the new spec is not empty. if (end != begin) specs = {begin, detail::to_unsigned(end - begin)}; // basic_string_view<>::compare isn't constexpr before C++17. if (specs.size() == 2 && specs[0] == Char('%')) {