CToken: std::move buildParams within CObjectReference's constructor

CVParamTransfer contains a std::shared_ptr, so a copy here performs an
unnecessary reference count increment and decrement. We can std::move
here to avoid this.
This commit is contained in:
Lioncash 2019-09-30 02:34:08 -04:00
parent 2014650d58
commit 541adb02d2
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ u16 CObjectReference::RemoveReference() {
CObjectReference::CObjectReference(IObjectStore& objStore, std::unique_ptr<IObj>&& obj, const SObjectTag& objTag, CObjectReference::CObjectReference(IObjectStore& objStore, std::unique_ptr<IObj>&& obj, const SObjectTag& objTag,
CVParamTransfer buildParams) CVParamTransfer buildParams)
: x4_objTag(objTag), xC_objectStore(&objStore), x10_object(std::move(obj)), x14_params(buildParams) {} : x4_objTag(objTag), xC_objectStore(&objStore), x10_object(std::move(obj)), x14_params(std::move(buildParams)) {}
CObjectReference::CObjectReference(std::unique_ptr<IObj>&& obj) : x10_object(std::move(obj)) {} CObjectReference::CObjectReference(std::unique_ptr<IObj>&& obj) : x10_object(std::move(obj)) {}
void CObjectReference::Unlock() { void CObjectReference::Unlock() {