File tree Expand file tree Collapse file tree 3 files changed +14
-28
lines changed
Expand file tree Collapse file tree 3 files changed +14
-28
lines changed Original file line number Diff line number Diff line change @@ -32,18 +32,10 @@ static int get_concurrency() {
3232}
3333
3434using namespace std ::placeholders;
35+ using namespace std ::literals;
3536
3637namespace librados {
3738
38- namespace {
39-
40- const char *config_keys[] = {
41- " librados_thread_count" ,
42- NULL
43- };
44-
45- } // anonymous namespace
46-
4739static void finish_aio_completion (AioCompletionImpl *c, int r) {
4840 c->lock .lock ();
4941 c->complete = true ;
@@ -142,8 +134,12 @@ boost::asio::io_context& TestRadosClient::get_io_context() {
142134 return m_io_context_pool->get_io_context ();
143135}
144136
145- const char ** TestRadosClient::get_tracked_conf_keys () const {
146- return config_keys;
137+ std::vector<std::string>TestRadosClient::get_tracked_keys ()
138+ const noexcept
139+ {
140+ return {
141+ " librados_thread_count" s
142+ };
147143}
148144
149145void TestRadosClient::handle_conf_change (
Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ class TestRadosClient : public md_config_obs_t {
136136 virtual void transaction_finish (const std::string& nspace,
137137 const std::string &oid) = 0;
138138
139- const char ** get_tracked_conf_keys () const override ;
139+ std::vector<std::string> get_tracked_keys () const noexcept override ;
140140 void handle_conf_change (const ConfigProxy& conf,
141141 const std::set<std::string> &changed) override ;
142142
Original file line number Diff line number Diff line change 3131#include " msg/async/Stack.h"
3232
3333using namespace std ;
34+ using namespace std ::literals;
3435
3536class NoopConfigObserver : public md_config_obs_t {
36- std::list<std::string> options;
37- const char **ptrs = 0 ;
37+ std::vector<std::string> options;
3838
3939public:
40- NoopConfigObserver (std::list<std::string> l) : options(l) {
41- ptrs = new const char *[options.size () + 1 ];
42- unsigned j = 0 ;
43- for (auto & i : options) {
44- ptrs[j++] = i.c_str ();
45- }
46- ptrs[j] = 0 ;
47- }
48- ~NoopConfigObserver () {
49- delete[] ptrs;
50- }
51-
52- const char ** get_tracked_conf_keys () const override {
53- return ptrs;
40+ NoopConfigObserver (std::vector<std::string> l) : options(l) {}
41+ ~NoopConfigObserver () = default ;
42+ std::vector<std::string> get_tracked_keys () const noexcept override {
43+ return options;
5444 }
5545 void handle_conf_change (const ConfigProxy& conf,
5646 const std::set <std::string> &changed) override {
You can’t perform that action at this time.
0 commit comments