From: Adam C. Emerson Date: Fri, 15 Mar 2019 19:18:21 +0000 (-0400) Subject: msg: Add optimizing move X-Git-Tag: v15.0.0~178^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9908f0e652b95051ab0aad40ef3ff5bad58f6d2f;p=ceph.git msg: Add optimizing move Variables declared in the function should be returned without using `std::move`, but parameters to the function should be returned *with* std::move. (If one wants them to move.) (I know it's complicated. Sorry.) Signed-off-by: Adam C. Emerson --- diff --git a/src/msg/async/frames_v2.h b/src/msg/async/frames_v2.h index 9975b74aa9fc..3c92d8cf193c 100644 --- a/src/msg/async/frames_v2.h +++ b/src/msg/async/frames_v2.h @@ -161,7 +161,7 @@ static ceph::bufferlist segment_onwire_bufferlist(ceph::bufferlist&& bl) if (padding_size) { bl.append_zero(padding_size); } - return bl; + return std::move(bl); } template