os/bluestore: Do not copy a string just to find its length

I really dislike whoever decided to disallow taking the address of
member functions in the standard library.

Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
This commit is contained in:
Adam C. Emerson 2017-11-20 16:13:01 -05:00
parent 7344796570
commit f26851b6d4

View File

@ -4727,8 +4727,11 @@ int BlueStore::_open_db(bool create, bool to_repair_db)
env->CreateDir(fn);
if (cct->_conf->rocksdb_separate_wal_dir)
env->CreateDir(fn + ".wal");
if (cct->_conf->get_val<std::string>("rocksdb_db_paths").length())
env->CreateDir(fn + ".slow");
if (cct->_conf->with_val<std::string>(
"rocksdb_db_paths", [](const std::string& s) {
return s.length(); }))
env->CreateDir(fn + ".slow");
}
} else if (create) {
int r = ::mkdir(fn.c_str(), 0755);