From 28b653616eb7a3ba85db0063f4704eefc5a75d55 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Mon, 9 Oct 2017 09:45:57 +0800 Subject: [PATCH] common/config: s/_get_val/_get_val_generic/ avoid distinguish two methods with their return types and non-templated versus templated. also, this follows the convention of md_config_t. Signed-off-by: Kefu Chai --- src/common/config.cc | 6 +++--- src/common/config.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/config.cc b/src/common/config.cc index 4883418c03ab5..2b54a3bf95bfb 100644 --- a/src/common/config.cc +++ b/src/common/config.cc @@ -874,10 +874,10 @@ int md_config_t::get_val(const std::string &key, char **buf, int len) const Option::value_t md_config_t::get_val_generic(const std::string &key) const { Mutex::Locker l(lock); - return _get_val(key); + return _get_val_generic(key); } -Option::value_t md_config_t::_get_val(const std::string &key) const +Option::value_t md_config_t::_get_val_generic(const std::string &key) const { assert(lock.is_locked()); @@ -902,7 +902,7 @@ 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(normalized_key.c_str()); + Option::value_t config_value = _get_val_generic(normalized_key.c_str()); if (!boost::get(&config_value)) { ostringstream oss; if (bool *flag = boost::get(&config_value)) { diff --git a/src/common/config.h b/src/common/config.h index 768521f9489ea..8c4d566a50e93 100644 --- a/src/common/config.h +++ b/src/common/config.h @@ -200,7 +200,7 @@ private: void validate_default_settings(); int _get_val(const std::string &key, std::string *value) const; - Option::value_t _get_val(const std::string &key) const; + Option::value_t _get_val_generic(const std::string &key) const; void _show_config(std::ostream *out, Formatter *f); void _get_my_sections(std::vector §ions) const; @@ -340,7 +340,7 @@ template T md_config_t::get_val(const std::string &key) const { } template T md_config_t::_get_val(const std::string &key) const { - Option::value_t generic_val = this->_get_val(key); + Option::value_t generic_val = this->_get_val_generic(key); get_typed_value_visitor gtv; return boost::apply_visitor(gtv, generic_val); } -- 2.39.5