]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
msg: Add optimizing move
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 15 Mar 2019 19:18:21 +0000 (15:18 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 15 Mar 2019 19:19:29 +0000 (15:19 -0400)
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 <aemerson@redhat.com>
src/msg/async/frames_v2.h

index 9975b74aa9fcac1dd739224fd3326f19fd4b5aa2..3c92d8cf193ceadba55961e0daa22bd533b946b7 100644 (file)
@@ -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 <class T, uint16_t... SegmentAlignmentVs>