mirror of
https://github.com/fmtlib/fmt.git
synced 2024-12-24 12:14:26 +00:00
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:
parent
0415cf2350
commit
e00997b004
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user