Skip to content

Commit

Permalink
Avoid extra reserve
Browse files Browse the repository at this point in the history
  • Loading branch information
vitaut committed Jul 14, 2024
1 parent 58d792b commit c910261
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions include/fmt/format.h
Original file line number Diff line number Diff line change
Expand Up @@ -3629,9 +3629,7 @@ auto write(OutputIt out, monostate, format_specs = {}, locale_ref = {})
template <typename Char, typename OutputIt>
FMT_CONSTEXPR auto write(OutputIt out, basic_string_view<Char> value)
-> OutputIt {
auto it = reserve(out, value.size());
it = copy_noinline<Char>(value.begin(), value.end(), it);
return base_iterator(out, it);
return copy_noinline<Char>(value.begin(), value.end(), out);
}

template <typename Char, typename OutputIt, typename T,
Expand Down

0 comments on commit c910261

Please sign in to comment.