CPackage: std::move strings in constructor where applicable

Allows calling code to completely avoid copies.
This commit is contained in:
Lioncash 2020-06-18 18:46:35 -04:00
parent bf9be7f2ad
commit 36e005844f
2 changed files with 4 additions and 4 deletions

View File

@ -62,7 +62,7 @@ bool CGameProject::Serialize(IArchive& rArc)
TString PackageName = packagePath.GetFileName(false);
TString PackageDir = packagePath.GetFileDirectory();
auto pPackage = std::make_unique<CPackage>(this, PackageName, PackageDir);
auto pPackage = std::make_unique<CPackage>(this, std::move(PackageName), std::move(PackageDir));
const bool PackageLoadSuccess = pPackage->Load();
mPackages.push_back(std::move(pPackage));

View File

@ -46,10 +46,10 @@ class CPackage
public:
CPackage() = default;
CPackage(CGameProject *pProj, const TString& rkName, const TString& rkPath)
CPackage(CGameProject *pProj, TString rkName, TString rkPath)
: mpProject(pProj)
, mPakName(rkName)
, mPakPath(rkPath)
, mPakName(std::move(rkName))
, mPakPath(std::move(rkPath))
, mCacheDirty(true)
{}