improved use of find (#1560)

* improved use of find

*begin is supposed to be different from '{' when this find is used, so we can avoid checking it.
This commit is contained in:
IkarusDeveloper 2020-02-21 23:43:07 +01:00 committed by GitHub
parent 0415cf2350
commit e00997b004
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2543,7 +2543,7 @@ FMT_CONSTEXPR void parse_format_string(basic_string_view<Char> 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<IS_CONSTEXPR>(begin, end, '{', p))
if (*begin != '{' && !find<IS_CONSTEXPR>(begin + 1, end, '{', p))
return write(begin, end);
write(begin, p);
++p;