mirror of
https://github.com/ceph/ceph
synced 2025-03-25 11:48:05 +00:00
monc: Remove pessimizing move
Calling std::move on on a function returning a value can interfere with RVO. At best it has no effect, but can actively interfere with Copy/Move Elision and make code less efficient. Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
parent
5da652e1d9
commit
05fed82cf4
@ -623,7 +623,7 @@ MonConnection& MonClient::_add_conn(unsigned rank, uint64_t global_id)
|
||||
auto peer = monmap.get_addr(rank);
|
||||
auto conn = messenger->get_connection(monmap.get_inst(rank));
|
||||
MonConnection mc(cct, conn, global_id);
|
||||
auto inserted = pending_cons.insert(move(make_pair(peer, move(mc))));
|
||||
auto inserted = pending_cons.insert(make_pair(peer, move(mc)));
|
||||
ldout(cct, 10) << "picked mon." << monmap.get_name(rank)
|
||||
<< " con " << conn
|
||||
<< " addr " << conn->get_peer_addr()
|
||||
|
Loading…
Reference in New Issue
Block a user