From: Patrick Donnelly Date: Fri, 5 Apr 2019 23:05:42 +0000 (-0700) Subject: msg/async: move connection ref X-Git-Tag: v14.2.2~104^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=65205e773dcd12aa07a37b432988dc9d9d6c0f90;p=ceph.git msg/async: move connection ref Trivial optimization. Signed-off-by: Patrick Donnelly (cherry picked from commit 5134a7ddbb7ddee46716ad542a3a9859b104e991) --- diff --git a/src/msg/async/AsyncMessenger.h b/src/msg/async/AsyncMessenger.h index 809a3df9c163..98bf9d526308 100644 --- a/src/msg/async/AsyncMessenger.h +++ b/src/msg/async/AsyncMessenger.h @@ -401,8 +401,8 @@ public: */ void unregister_conn(AsyncConnectionRef conn) { Mutex::Locker l(deleted_lock); - deleted_conns.insert(conn); conn->get_perf_counter()->dec(l_msgr_active_connections); + deleted_conns.emplace(std::move(conn)); if (deleted_conns.size() >= ReapDeadConnectionThreshold) { local_worker->center.dispatch_event_external(reap_handler);