Skip to content

Commit

Permalink
do not std::move out of functions
Browse files Browse the repository at this point in the history
  • Loading branch information
DubbleClick committed Dec 20, 2023
1 parent 3c82b3c commit 739cea0
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions GWToolboxdll/Utils/GuiUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,7 @@ namespace GuiUtils {
ASSERT(size_needed != 0);
std::string str_to(size_needed, 0);
ASSERT(WideCharToMultiByte(CP_UTF8, 0, str.data(), static_cast<int>(str.size()), str_to.data(), size_needed, NULL, NULL));
return std::move(str_to);
return str_to;
}

// Makes sure the file name doesn't have chars that won't be allowed on disk
Expand Down Expand Up @@ -968,7 +968,7 @@ namespace GuiUtils {
out.resize(size + 1);
ASSERT(vsnprintf(out.data(), out.size(), msg, args) <= size);
va_end(args);
return std::move(out);
return out;
}

std::wstring format(const wchar_t* msg, ...)
Expand All @@ -980,7 +980,7 @@ namespace GuiUtils {
out.resize(size + 1);
ASSERT(_vsnwprintf(out.data(), out.size(), msg, args) <= size);
va_end(args);
return std::move(out);
return out;
}

std::string& EncString::string()
Expand Down
2 changes: 1 addition & 1 deletion GWToolboxdll/Utils/ToolboxUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -653,6 +653,6 @@ namespace ToolboxUtils {
original += L"\x2\x102\x2\x108\x107" L"Customized\x1";
}

return std::move(original);
return original;
}
}
8 changes: 4 additions & 4 deletions plugins/Base/PluginUtils.ixx
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ namespace PluginUtils {
PLUGIN_ASSERT(size_needed != 0);
std::string strTo(size_needed, 0);
PLUGIN_ASSERT(WideCharToMultiByte(CP_UTF8, 0, s.data(), static_cast<int>(s.size()), strTo.data(), size_needed, NULL, NULL));
return std::move(strTo);
return strTo;
}

// Makes sure the file name doesn't have chars that won't be allowed on disk
Expand Down Expand Up @@ -568,7 +568,7 @@ namespace PluginUtils {
PLUGIN_ASSERT(size_needed != 0);
std::wstring wstrTo(size_needed, 0);
PLUGIN_ASSERT(MultiByteToWideChar(CP_UTF8, 0, str.data(), static_cast<int>(str.size()), wstrTo.data(), size_needed));
return std::move(wstrTo);
return wstrTo;
}

std::wstring SanitizePlayerName(const std::wstring& s)
Expand Down Expand Up @@ -970,7 +970,7 @@ namespace PluginUtils {
out.resize(size + 1);
PLUGIN_ASSERT(vsnprintf(out.data(), out.size(), msg, args) <= size);
va_end(args);
return std::move(out);
return out;
}

std::wstring format(const wchar_t* msg, ...)
Expand All @@ -982,7 +982,7 @@ namespace PluginUtils {
out.resize(size + 1);
PLUGIN_ASSERT(_vsnwprintf(out.data(), out.size(), msg, args) <= size);
va_end(args);
return std::move(out);
return out;
}

std::string& EncString::string()
Expand Down

0 comments on commit 739cea0

Please sign in to comment.