]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
crimson/net: remove redundant std::move()
authorKefu Chai <kchai@redhat.com>
Thu, 30 May 2019 05:52:40 +0000 (13:52 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 30 May 2019 14:06:46 +0000 (22:06 +0800)
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 <kchai@redhat.com>
src/crimson/net/ProtocolV2.cc

index 315936140bd45333724ec9f6c0000c129741fdd4..64288423b6b40ef3f51c34066831543a9412f69a 100644 (file)
@@ -143,7 +143,7 @@ seastar::future<Socket::tmp_buf> 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<bufferlist> 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);