]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: use more efficient data structure
authorPatrick Donnelly <pdonnell@redhat.com>
Tue, 3 Dec 2019 01:57:48 +0000 (17:57 -0800)
committerPatrick Donnelly <pdonnell@redhat.com>
Wed, 4 Dec 2019 01:53:13 +0000 (17:53 -0800)
Signed-off-by: Patrick Donnelly <pdonnell@redhat.com>
src/mgr/MgrStandby.cc
src/mgr/PyModuleRegistry.h

index b021a1829715efe43da75f23f0d0194523408bad..1d806569c3976ae045e1e7256557e84f2bda6e69 100644 (file)
@@ -192,7 +192,7 @@ void MgrStandby::send_beacon()
   ceph_assert(ceph_mutex_is_locked_by_me(lock));
   dout(20) << state_str() << dendl;
 
-  std::list<PyModuleRef> modules = py_module_registry.get_modules();
+  auto modules = py_module_registry.get_modules();
 
   // Construct a list of the info about each loaded module
   // which we will transmit to the monitor.
index 6d30d126648eb658d9df70eef1e25c95fb8b5805..c7f8b806d964453446c50fe10f2040bb92f5cd39 100644 (file)
@@ -69,10 +69,10 @@ public:
    * Get references to all modules (whether they have loaded and/or
    * errored) or not.
    */
-  std::list<PyModuleRef> get_modules() const
+  auto get_modules() const
   {
+    std::vector<PyModuleRef> modules_out;
     std::lock_guard l(lock);
-    std::list<PyModuleRef> modules_out;
     for (const auto &i : modules) {
       modules_out.push_back(i.second);
     }