From: Kefu Chai Date: Thu, 30 May 2019 05:52:40 +0000 (+0800) Subject: crimson/net: remove redundant std::move() X-Git-Tag: v15.1.0~2604^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=b300d60ffb196e5594fa57d06d0788ebc960f6f2;p=ceph.git crimson/net: remove redundant std::move() see https://en.cppreference.com/w/cpp/language/copy_elision it also silences warning like: src/crimson/net/ProtocolV2.cc:146:26: warning: redundant move in return statement [-Wredundant-move] 146 | return std::move(bl); | ^ Signed-off-by: Kefu Chai --- diff --git a/src/crimson/net/ProtocolV2.cc b/src/crimson/net/ProtocolV2.cc index 315936140bd4..64288423b6b4 100644 --- a/src/crimson/net/ProtocolV2.cc +++ b/src/crimson/net/ProtocolV2.cc @@ -143,7 +143,7 @@ seastar::future ProtocolV2::read_exactly(size_t bytes) return socket->read_exactly(bytes) .then([this] (auto bl) { rxbuf.append(buffer::create(bl.share())); - return std::move(bl); + return bl; }); } else { return socket->read_exactly(bytes); @@ -156,7 +156,7 @@ seastar::future ProtocolV2::read(size_t bytes) return socket->read(bytes) .then([this] (auto buf) { rxbuf.append(buf); - return std::move(buf); + return buf; }); } else { return socket->read(bytes);