Avoid extra reserve

This commit is contained in:
Victor Zverovich 2024-07-14 08:41:35 -07:00
parent 58d792b6d3
commit c9102619da

View File

@ -3629,9 +3629,7 @@ auto write(OutputIt out, monostate, format_specs = {}, locale_ref = {})
template <typename Char, typename OutputIt> template <typename Char, typename OutputIt>
FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> value) FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> value)
-> OutputIt { -> OutputIt {
auto it = reserve(out, value.size()); return copy_noinline<Char>(value.begin(), value.end(), out);
it = copy_noinline<Char>(value.begin(), value.end(), it);
return base_iterator(out, it);
} }
template <typename Char, typename OutputIt, typename T, template <typename Char, typename OutputIt, typename T,