From beb248b6ac4d366783305a25af47d52b03181cf8 Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 11 Nov 2020 06:03:19 -0800 Subject: [PATCH] Optimize handling of large format strings --- include/fmt/format.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 9970444c..5a59f0b9 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3070,9 +3070,7 @@ struct format_handler : detail::error_handler { void on_text(const Char* begin, const Char* end) { auto size = to_unsigned(end - begin); auto out = context.out(); - auto&& it = reserve(out, size); - it = std::copy_n(begin, size, it); - context.advance_to(out); + context.advance_to(write(out, basic_string_view(begin, size))); } int on_arg_id() { return parse_context.next_arg_id(); }