]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: do not "return std::move(local_var)"
authorKefu Chai <kchai@redhat.com>
Fri, 15 Mar 2019 03:22:13 +0000 (11:22 +0800)
committerSage Weil <sage@redhat.com>
Fri, 15 Mar 2019 12:07:07 +0000 (07:07 -0500)
it prevents copy elision. and both GCC and Clang warn like

warning: moving a local object in a return statement prevents copy
elision [-Wpessimizing-move]

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/msg/async/crypto_onwire.cc

index 0fa35cac409650eb079e598814f28c2ff7ac3d42..3858091357d2f8a1eb4e7e3b691feb22e38a0862 100644 (file)
@@ -225,7 +225,7 @@ ceph::bufferlist AES128GCM_OnWireRxHandler::authenticated_decrypt_update(
 
   ceph::bufferlist outbl;
   outbl.push_back(std::move(plainnode));
-  return std::move(outbl);
+  return outbl;
 }