CPackage: std::move strings in constructor where applicable
Allows calling code to completely avoid copies.
This commit is contained in:
parent
bf9be7f2ad
commit
36e005844f
|
@ -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));
|
||||
|
||||
|
|
|
@ -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)
|
||||
{}
|
||||
|
||||
|
|
Loading…
Reference in New Issue