Skip to content

Commit

Permalink
add some std::move
Browse files Browse the repository at this point in the history
  • Loading branch information
gansm committed May 31, 2023
1 parent 382891a commit 63af59f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions final/util/fstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ auto FString::setFormatedNumber (sInt64 num, FString separator) -> FString&
*--s = '-';

std::wstring str{s};
internal_assign (str);
internal_assign (std::move(str));
return *this;
}

Expand All @@ -817,7 +817,7 @@ auto FString::setFormatedNumber (uInt64 num, FString separator) -> FString&
while ( num );

std::wstring str{s};
internal_assign (str);
internal_assign (std::move(str));
return *this;
}

Expand Down
8 changes: 4 additions & 4 deletions final/util/fstring.h
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ class FString
auto setNumber (lDouble, int = int(getPrecision<lDouble>())) -> FString&;

template <typename NumT>
auto setFormatedNumber (NumT, FString = nl_langinfo(THOUSEP)) -> FString&;
auto setFormatedNumber (NumT, FString&& = nl_langinfo(THOUSEP)) -> FString&;
auto setFormatedNumber (sInt64, FString = nl_langinfo(THOUSEP)) -> FString&;
auto setFormatedNumber (uInt64, FString = nl_langinfo(THOUSEP)) -> FString&;

Expand Down Expand Up @@ -690,12 +690,12 @@ inline auto FString::setNumber (NumT num, int precision) -> FString&

//----------------------------------------------------------------------
template <typename NumT>
inline auto FString::setFormatedNumber (NumT num, FString separator) -> FString&
inline auto FString::setFormatedNumber (NumT num, FString&& separator) -> FString&
{
if ( isNegative(num) )
return setFormatedNumber (sInt64(num), separator);
return setFormatedNumber (sInt64(num), std::move(separator));

return setFormatedNumber (uInt64(num), separator);
return setFormatedNumber (uInt64(num), std::move(separator));
}


Expand Down

0 comments on commit 63af59f

Please sign in to comment.