]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
common/config: limit calls to normalize_key_name
authorPiotr Dałek <piotr.dalek@corp.ovh.com>
Mon, 5 Feb 2018 13:36:11 +0000 (14:36 +0100)
committerPiotr Dałek <piotr.dalek@corp.ovh.com>
Mon, 5 Feb 2018 13:56:33 +0000 (14:56 +0100)
It's not the most expensive thing in that module, but it's redundant
in _get_val, as it's later done also in _get_val_generic. And it's
still expensive.

Signed-off-by: Piotr Dałek <piotr.dalek@corp.ovh.com>
src/common/config.cc

index cb2a756f036c1e7a861248739e2467826ad128eb..9642ccd311175292a3d95d645f4bbffeac451e72 100644 (file)
@@ -905,8 +905,7 @@ Option::value_t md_config_t::_get_val_generic(const std::string &key) const
 int md_config_t::_get_val(const std::string &key, std::string *value) const {
   assert(lock.is_locked());
 
-  std::string normalized_key(ConfFile::normalize_key_name(key));
-  Option::value_t config_value = _get_val_generic(normalized_key.c_str());
+  auto config_value = _get_val_generic(key);
   if (!boost::get<boost::blank>(&config_value)) {
     ostringstream oss;
     if (bool *flag = boost::get<bool>(&config_value)) {