소스 검색

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.
Lioncash 8 년 전
부모
커밋
f4c24d0832
2개의 변경된 파일2개의 추가작업 그리고 3개의 파일을 삭제
  1. 1 2
      src/core/hle/kernel/object.h
  2. 1 1
      src/core/hle/kernel/wait_object.h

+ 1 - 2
src/core/hle/kernel/object.h

@@ -6,7 +6,6 @@
 
 #include <atomic>
 #include <string>
-#include <utility>
 
 #include <boost/smart_ptr/intrusive_ptr.hpp>
 
@@ -97,7 +96,7 @@ using SharedPtr = boost::intrusive_ptr<T>;
 template <typename T>
 inline SharedPtr<T> DynamicObjectCast(SharedPtr<Object> object) {
     if (object != nullptr && object->GetHandleType() == T::HANDLE_TYPE) {
-        return boost::static_pointer_cast<T>(std::move(object));
+        return boost::static_pointer_cast<T>(object);
     }
     return nullptr;
 }

+ 1 - 1
src/core/hle/kernel/wait_object.h

@@ -69,7 +69,7 @@ private:
 template <>
 inline SharedPtr<WaitObject> DynamicObjectCast<WaitObject>(SharedPtr<Object> object) {
     if (object != nullptr && object->IsWaitable()) {
-        return boost::static_pointer_cast<WaitObject>(std::move(object));
+        return boost::static_pointer_cast<WaitObject>(object);
     }
     return nullptr;
 }