]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon/ConfigKeyService: pass strings by const ref
authorMichal Jarzabek <stiopa@gmail.com>
Mon, 8 Aug 2016 22:03:40 +0000 (23:03 +0100)
committerMichal Jarzabek <stiopa@gmail.com>
Mon, 8 Aug 2016 22:03:40 +0000 (23:03 +0100)
Signed-off-by: Michal Jarzabek <stiopa@gmail.com>
src/mon/ConfigKeyService.cc
src/mon/ConfigKeyService.h

index 2d78789774662b8cde8e60f1ebd4d9323f06ea5b..df180b7a636dfa5820d82bdfc2fb98d7d4efbbd0 100644 (file)
@@ -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<string>& 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);
 }
index e03b92e27db7e3dc6a4d20cbac2e5bd3045634df..4d2b072fe62478c5d75ef04a32e4f8536d451491 100644 (file)
@@ -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;