From: Patrick Donnelly Date: Tue, 3 Dec 2019 01:57:48 +0000 (-0800) Subject: mgr: use more efficient data structure X-Git-Tag: v15.1.0~672^2~4 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=78576c9eecf2209ab69bccb17a2f862db8beffbf;p=ceph.git mgr: use more efficient data structure Signed-off-by: Patrick Donnelly --- diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index b021a1829715e..1d806569c3976 100644 --- a/src/mgr/MgrStandby.cc +++ b/src/mgr/MgrStandby.cc @@ -192,7 +192,7 @@ void MgrStandby::send_beacon() ceph_assert(ceph_mutex_is_locked_by_me(lock)); dout(20) << state_str() << dendl; - std::list 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. diff --git a/src/mgr/PyModuleRegistry.h b/src/mgr/PyModuleRegistry.h index 6d30d126648eb..c7f8b806d9644 100644 --- a/src/mgr/PyModuleRegistry.h +++ b/src/mgr/PyModuleRegistry.h @@ -69,10 +69,10 @@ public: * Get references to all modules (whether they have loaded and/or * errored) or not. */ - std::list get_modules() const + auto get_modules() const { + std::vector modules_out; std::lock_guard l(lock); - std::list modules_out; for (const auto &i : modules) { modules_out.push_back(i.second); }