From 541adb02d2213e22247bf5de44664c2489d46324 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Mon, 30 Sep 2019 02:34:08 -0400 Subject: [PATCH] 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. --- Runtime/CToken.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Runtime/CToken.cpp b/Runtime/CToken.cpp index a9a47b681..a82937eaf 100644 --- a/Runtime/CToken.cpp +++ b/Runtime/CToken.cpp @@ -16,7 +16,7 @@ u16 CObjectReference::RemoveReference() { CObjectReference::CObjectReference(IObjectStore& objStore, std::unique_ptr&& obj, const SObjectTag& objTag, 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&& obj) : x10_object(std::move(obj)) {} void CObjectReference::Unlock() {