Core/Resource: Pass filePath by value and move to prevent useless copy

This commit is contained in:
SirLynix 2023-05-15 08:31:42 +02:00
parent 1d32af53c5
commit 34b8bb5d65
2 changed files with 3 additions and 3 deletions

View File

@ -23,7 +23,7 @@ namespace Nz
const std::filesystem::path& GetFilePath() const;
void SetFilePath(const std::filesystem::path& filePath);
void SetFilePath(std::filesystem::path filePath);
Resource& operator=(const Resource&) = default;
Resource& operator=(Resource&&) noexcept = default;

View File

@ -31,8 +31,8 @@ namespace Nz
* \param filePath Path to the resource
*/
void Resource::SetFilePath(const std::filesystem::path& filePath)
void Resource::SetFilePath(std::filesystem::path filePath)
{
m_filePath = filePath;
m_filePath = std::move(filePath);
}
}