]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg: Remove pessimizing move
authorAdam C. Emerson <aemerson@redhat.com>
Mon, 10 Apr 2017 17:02:43 +0000 (13:02 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Tue, 11 Apr 2017 01:57:14 +0000 (21:57 -0400)
Do not std::move the result of a function returning a value.

(Once could reasonably std::move the result of a function returning an
lvalue reference, but *not* that of one returning a value.)

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/msg/async/rdma/RDMAStack.cc

index 443ac7fa44885772d2526f5f6c3da0a6d02123fa..66c7e5634abc9a42dc61c00a46a7a362b167fe76 100644 (file)
@@ -526,7 +526,7 @@ RDMAStack::~RDMAStack()
 void RDMAStack::spawn_worker(unsigned i, std::function<void ()> &&func)
 {
   threads.resize(i+1);
-  threads[i] = std::move(std::thread(func));
+  threads[i] = std::thread(func);
 }
 
 void RDMAStack::join_worker(unsigned i)