]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: use reference to void string copy 16364/head
authorPan Liu <wanjun.lp@alibaba-inc.com>
Mon, 17 Jul 2017 12:26:42 +0000 (20:26 +0800)
committerPan Liu <wanjun.lp@alibaba-inc.com>
Mon, 17 Jul 2017 12:26:42 +0000 (20:26 +0800)
Signed-off-by: Pan Liu <wanjun.lp@alibaba-inc.com>
src/kv/RocksDBStore.cc
src/kv/RocksDBStore.h

index 01c2369ca6f0f4e08f962de8af1e204f207ea5ec..a58f529a99e7a45196649b7a146711064b8fa375 100644 (file)
@@ -139,7 +139,7 @@ rocksdb::Logger *create_rocksdb_ceph_logger()
   return new CephRocksdbLogger(g_ceph_context);
 }
 
-int string2bool(string val, bool &b_val)
+static int string2bool(const string &val, bool &b_val)
 {
   if (strcasecmp(val.c_str(), "false") == 0) {
     b_val = false;
@@ -157,7 +157,7 @@ int string2bool(string val, bool &b_val)
   }
 }
   
-int RocksDBStore::tryInterpret(const string key, const string val, rocksdb::Options &opt)
+int RocksDBStore::tryInterpret(const string &key, const string &val, rocksdb::Options &opt)
 {
   if (key == "compaction_threads") {
     std::string err;
@@ -188,7 +188,7 @@ int RocksDBStore::tryInterpret(const string key, const string val, rocksdb::Opti
   return 0;
 }
 
-int RocksDBStore::ParseOptionsFromString(const string opt_str, rocksdb::Options &opt)
+int RocksDBStore::ParseOptionsFromString(const string &opt_str, rocksdb::Options &opt)
 {
   map<string, string> str_map;
   int r = get_str_map(opt_str, &str_map, ",\n;");
index 321653448973f5327aa3459e8c55d9fa94e5e242..6a7c0e37772b275cbb90a9ff50c501bd23ee2867 100644 (file)
@@ -108,8 +108,8 @@ public:
   bool enable_rmrange;
   void compact() override;
 
-  int tryInterpret(const string key, const string val, rocksdb::Options &opt);
-  int ParseOptionsFromString(const string opt_str, rocksdb::Options &opt);
+  int tryInterpret(const string& key, const string& val, rocksdb::Options &opt);
+  int ParseOptionsFromString(const string& opt_str, rocksdb::Options &opt);
   static int _test_init(const string& dir);
   int init(string options_str) override;
   /// compact rocksdb for all keys with a given prefix