Browse Source

Clang-Tidy - modernize-pass-by-value.

Yao Wei Tjong 姚伟忠 8 years ago
parent
commit
d23ee35938
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Source/Urho3D/Core/Object.h

+ 2 - 1
Source/Urho3D/Core/Object.h

@@ -25,6 +25,7 @@
 #include "../Container/LinkedList.h"
 #include "../Core/Variant.h"
 #include <functional>
+#include <utility>
 
 namespace Urho3D
 {
@@ -331,7 +332,7 @@ public:
     /// Construct with receiver and function pointers and userdata.
     EventHandler11Impl(std::function<void(StringHash, VariantMap&)> function, void* userData = nullptr) :
         EventHandler(nullptr, userData),
-        function_(function)
+        function_(std::move(function))
     {
         assert(function_);
     }