From dc8025f7933e734736d6b2af49b350b93e2fdefd Mon Sep 17 00:00:00 2001 From: IkarusDeveloper <52773127+IkarusDeveloper@users.noreply.github.com> Date: Fri, 21 Feb 2020 00:21:13 +0100 Subject: [PATCH] improved use of find *begin is supposed to be different from '{' when this find is used, so we can avoid checking it. --- include/fmt/format.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index c9abfe48..7e06c288 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -2543,7 +2543,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view format_str, // Doing two passes with memchr (one for '{' and another for '}') is up to // 2.5x faster than the naive one-pass implementation on big format strings. const Char* p = begin; - if (*begin != '{' && !find(begin, end, '{', p)) + if (*begin != '{' && !find(begin+1, end, '{', p)) return write(begin, end); write(begin, p); ++p;