mirror of
https://github.com/fmtlib/fmt.git
synced 2025-01-12 06:37:28 +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
|
// 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.
|
// 2.5x faster than the naive one-pass implementation on big format strings.
|
||||||
const Char* p = begin;
|
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);
|
return write(begin, end);
|
||||||
write(begin, p);
|
write(begin, p);
|
||||||
++p;
|
++p;
|
||||||
|
Loading…
Reference in New Issue
Block a user