Use more std::move

This commit is contained in:
Megamouse
2026-06-10 02:15:16 +02:00
parent 27b13dff20
commit 5252f47a33
33 changed files with 168 additions and 157 deletions
+4 -4
View File
@@ -119,18 +119,18 @@ namespace utils
if (sym->NameLen)
{
const auto function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
std::string function_name = wstr_to_utf8(sym->Name, static_cast<int>(sym->NameLen));
// Attempt to get file and line information if available
DWORD unused2;
if (SymGetLineFromAddrW64(hProcess, reinterpret_cast<DWORD64>(pointer), &unused2, &line_info))
{
const auto full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
result.push_back(full_path);
std::string full_path = fmt::format("%s:%u %s", wstr_to_utf8(line_info.FileName, -1), line_info.LineNumber, function_name);
result.push_back(std::move(full_path));
}
else
{
result.push_back(function_name);
result.push_back(std::move(function_name));
}
}
else
+1 -1
View File
@@ -33,7 +33,7 @@ public:
std::lock_guard lock(mutex);
if (std::shared_ptr<void> new_val = std::invoke(func); new_val)
{
storage.push_back(new_val);
storage.push_back(std::move(new_val));
}
delete_unused();
}