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>
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);
return socket->read(bytes)
.then([this] (auto buf) {
rxbuf.append(buf);
- return std::move(buf);
+ return buf;
});
} else {
return socket->read(bytes);