From: Michal Jarzabek Date: Mon, 8 Aug 2016 22:03:40 +0000 (+0100) Subject: mon/ConfigKeyService: pass strings by const ref X-Git-Tag: v11.0.1~194^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fb34cd5b113b0176dba06e4ddbbefedd390791c4;p=ceph.git mon/ConfigKeyService: pass strings by const ref Signed-off-by: Michal Jarzabek --- diff --git a/src/mon/ConfigKeyService.cc b/src/mon/ConfigKeyService.cc index 2d7878977466..df180b7a636d 100644 --- a/src/mon/ConfigKeyService.cc +++ b/src/mon/ConfigKeyService.cc @@ -33,7 +33,7 @@ static ostream& _prefix(std::ostream *_dout, const Monitor *mon, const string ConfigKeyService::STORE_PREFIX = "mon_config_key"; -int ConfigKeyService::store_get(string key, bufferlist &bl) +int ConfigKeyService::store_get(const string &key, bufferlist &bl) { return mon->store->get(STORE_PREFIX, key, bl); } @@ -43,7 +43,7 @@ void ConfigKeyService::get_store_prefixes(set& s) s.insert(STORE_PREFIX); } -void ConfigKeyService::store_put(string key, bufferlist &bl, Context *cb) +void ConfigKeyService::store_put(const string &key, bufferlist &bl, Context *cb) { MonitorDBStore::TransactionRef t = paxos->get_pending_transaction(); t->put(STORE_PREFIX, key, bl); @@ -52,7 +52,7 @@ void ConfigKeyService::store_put(string key, bufferlist &bl, Context *cb) paxos->trigger_propose(); } -void ConfigKeyService::store_delete(string key, Context *cb) +void ConfigKeyService::store_delete(const string &key, Context *cb) { MonitorDBStore::TransactionRef t = paxos->get_pending_transaction(); t->erase(STORE_PREFIX, key); @@ -61,7 +61,7 @@ void ConfigKeyService::store_delete(string key, Context *cb) paxos->trigger_propose(); } -bool ConfigKeyService::store_exists(string key) +bool ConfigKeyService::store_exists(const string &key) { return mon->store->exists(STORE_PREFIX, key); } diff --git a/src/mon/ConfigKeyService.h b/src/mon/ConfigKeyService.h index e03b92e27db7..4d2b072fe624 100644 --- a/src/mon/ConfigKeyService.h +++ b/src/mon/ConfigKeyService.h @@ -26,11 +26,11 @@ class ConfigKeyService : public QuorumService { Paxos *paxos; - int store_get(string key, bufferlist &bl); - void store_put(string key, bufferlist &bl, Context *cb = NULL); - void store_delete(string key, Context *cb = NULL); + int store_get(const string &key, bufferlist &bl); + void store_put(const string &key, bufferlist &bl, Context *cb = NULL); + void store_delete(const string &key, Context *cb = NULL); void store_list(stringstream &ss); - bool store_exists(string key); + bool store_exists(const string &key); static const string STORE_PREFIX;