Skip to content

Commit c0cd0fc

Browse files
authored
Add missing moves to grouping std::string member (#4704)
1 parent 245e4d9 commit c0cd0fc

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

include/fmt/format.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1219,7 +1219,7 @@ FMT_API auto thousands_sep_impl(locale_ref loc) -> thousands_sep_result<Char>;
12191219
template <typename Char>
12201220
inline auto thousands_sep(locale_ref loc) -> thousands_sep_result<Char> {
12211221
auto result = thousands_sep_impl<char>(loc);
1222-
return {result.grouping, Char(result.thousands_sep)};
1222+
return {std::move(result.grouping), Char(result.thousands_sep)};
12231223
}
12241224
template <>
12251225
inline auto thousands_sep(locale_ref loc) -> thousands_sep_result<wchar_t> {
@@ -1968,7 +1968,7 @@ template <typename Char> class digit_grouping {
19681968
explicit digit_grouping(locale_ref loc, bool localized = true) {
19691969
if (!localized) return;
19701970
auto sep = thousands_sep<Char>(loc);
1971-
grouping_ = sep.grouping;
1971+
grouping_ = std::move(sep.grouping);
19721972
if (sep.thousands_sep) thousands_sep_.assign(1, sep.thousands_sep);
19731973
}
19741974
digit_grouping(std::string grouping, std::basic_string<Char> sep)

0 commit comments

Comments
 (0)