Use more std::move
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user