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:
Adam C. Emerson 2017-04-10 11:48:57 -04:00
parent 5da652e1d9
commit 05fed82cf4

View File

@ -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()