Optimize common case

This commit is contained in:
Victor Zverovich
2020-06-15 18:13:40 -07:00
parent 7431165f38
commit 397ad1bec3
3 changed files with 21 additions and 3 deletions

View File

@@ -1475,7 +1475,7 @@ template <> struct formatter<Date> {
template <typename ParseContext>
FMT_CONSTEXPR auto parse(ParseContext& ctx) -> decltype(ctx.begin()) {
auto it = ctx.begin();
if (*it == 'd') ++it;
if (it != ctx.end() && *it == 'd') ++it;
return it;
}