From 60dc273513449dc959fc8212464058c54c7c36bb Mon Sep 17 00:00:00 2001 From: Victor Zverovich Date: Wed, 11 Nov 2020 15:13:44 -0800 Subject: [PATCH] Simplify on_text --- include/fmt/format.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 1c19d1c7..adf39d36 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -3089,9 +3089,8 @@ struct format_handler : detail::error_handler { : parse_context(str), context(out, format_args, loc) {} void on_text(const Char* begin, const Char* end) { - auto size = to_unsigned(end - begin); - auto out = context.out(); - context.advance_to(write(out, basic_string_view(begin, size))); + auto text = basic_string_view(begin, to_unsigned(end - begin)); + context.advance_to(write(context.out(), text)); } int on_arg_id() { return parse_context.next_arg_id(); }