]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
msg/async: move connection ref
authorPatrick Donnelly <pdonnell@redhat.com>
Fri, 5 Apr 2019 23:05:42 +0000 (16:05 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Mon, 8 Apr 2019 18:42:12 +0000 (11:42 -0700)
Trivial optimization.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/msg/async/AsyncMessenger.h

index 1ce3640db356a8b18a1c443aa89ba5eb335772a9..ca9e3294a9d6d668d238e70ef4df73bd2d650fa3 100644 (file)
@@ -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);