From 9c9347beac6a2db1a167ee0306fc36e4ae070c51 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Piotr=20Da=C5=82ek?= Date: Mon, 5 Feb 2018 14:36:11 +0100 Subject: [PATCH] common/config: limit calls to normalize_key_name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/common/config.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/common/config.cc b/src/common/config.cc index cb2a756f036..9642ccd3111 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -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(&config_value)) { ostringstream oss; if (bool *flag = boost::get(&config_value)) { -- 2.39.5