From f26851b6d44974ef62e7855e673387ff053aa6a4 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Mon, 20 Nov 2017 16:13:01 -0500 Subject: [PATCH] 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 --- src/os/bluestore/BlueStore.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/os/bluestore/BlueStore.cc b/src/os/bluestore/BlueStore.cc index d184dfa85d0..04cdedb9573 100644 --- a/src/os/bluestore/BlueStore.cc +++ b/src/os/bluestore/BlueStore.cc @@ -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("rocksdb_db_paths").length()) - env->CreateDir(fn + ".slow"); + + if (cct->_conf->with_val( + "rocksdb_db_paths", [](const std::string& s) { + return s.length(); })) + env->CreateDir(fn + ".slow"); } } else if (create) { int r = ::mkdir(fn.c_str(), 0755); -- 2.39.5