From 78576c9eecf2209ab69bccb17a2f862db8beffbf Mon Sep 17 00:00:00 2001 From: Patrick Donnelly Date: Mon, 2 Dec 2019 17:57:48 -0800 Subject: [PATCH] mgr: use more efficient data structure Signed-off-by: Patrick Donnelly --- src/mgr/MgrStandby.cc | 2 +- src/mgr/PyModuleRegistry.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mgr/MgrStandby.cc b/src/mgr/MgrStandby.cc index b021a182971..1d806569c39 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 6d30d126648..c7f8b806d96 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); } -- 2.39.5