Core/Resource: Pass filePath by value and move to prevent useless copy
This commit is contained in:
parent
1d32af53c5
commit
34b8bb5d65
|
|
@ -23,7 +23,7 @@ namespace Nz
|
||||||
|
|
||||||
const std::filesystem::path& GetFilePath() const;
|
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=(const Resource&) = default;
|
||||||
Resource& operator=(Resource&&) noexcept = default;
|
Resource& operator=(Resource&&) noexcept = default;
|
||||||
|
|
|
||||||
|
|
@ -31,8 +31,8 @@ namespace Nz
|
||||||
* \param filePath Path to the resource
|
* \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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue