From 9908f0e652b95051ab0aad40ef3ff5bad58f6d2f Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Fri, 15 Mar 2019 15:18:21 -0400 Subject: [PATCH] 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 --- src/msg/async/frames_v2.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msg/async/frames_v2.h b/src/msg/async/frames_v2.h index 9975b74aa9f..3c92d8cf193 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 -- 2.39.5