]> git-server-git.apps.pok.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)
committerNathan Cutler <ncutler@suse.com>
Thu, 25 Apr 2019 07:47:12 +0000 (09:47 +0200)
Trivial optimization.

Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
(cherry picked from commit 5134a7ddbb7ddee46716ad542a3a9859b104e991)

src/msg/async/AsyncMessenger.h

index 809a3df9c163ce7feb238311443c1639d73bf97e..98bf9d5263087e5aed532a17c69a2c290b06671c 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);