From d64094a0d205ad28ceb96b9858a8b370e6d538f2 Mon Sep 17 00:00:00 2001 From: Lioncash Date: Fri, 28 Sep 2018 02:10:22 -0400 Subject: [PATCH] kernel/object: Remove unnecessary std::move from DynamicObjectCast() boost::static_pointer_cast for boost::intrusive_ptr (what SharedPtr is), takes its parameter by const reference. Given that, it means that this std::move doesn't actually do anything other than obscure what the function's actual behavior is, so we can remove this. To clarify, this would only do something if the parameter was either taking its argument by value, by non-const ref, or by rvalue-reference. --- src/core/hle/kernel/object.h | 3 +-- src/core/hle/kernel/wait_object.h | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core/hle/kernel/object.h b/src/core/hle/kernel/object.h index 90cf120a27..fbacf93593 100644 --- a/src/core/hle/kernel/object.h +++ b/src/core/hle/kernel/object.h @@ -6,7 +6,6 @@ #include #include -#include #include @@ -99,7 +98,7 @@ using SharedPtr = boost::intrusive_ptr; template inline SharedPtr DynamicObjectCast(SharedPtr object) { if (object != nullptr && object->GetHandleType() == T::HANDLE_TYPE) { - return boost::static_pointer_cast(std::move(object)); + return boost::static_pointer_cast(object); } return nullptr; } diff --git a/src/core/hle/kernel/wait_object.h b/src/core/hle/kernel/wait_object.h index 5af04c6a86..2b9a9393b6 100644 --- a/src/core/hle/kernel/wait_object.h +++ b/src/core/hle/kernel/wait_object.h @@ -59,7 +59,7 @@ private: template <> inline SharedPtr DynamicObjectCast(SharedPtr object) { if (object != nullptr && object->IsWaitable()) { - return boost::static_pointer_cast(std::move(object)); + return boost::static_pointer_cast(object); } return nullptr; }