aboutsummaryrefslogtreecommitdiffstats
path: root/src/config/ConfigGlobal.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-02-19 23:57:55 +0100
committerMax Kellermann <max@duempel.org>2014-02-20 00:04:23 +0100
commit008723c62fe9686812758dfffb06d59f998f6204 (patch)
tree6bb222d69c3e13fc29a6b1ac449b7815944036db /src/config/ConfigGlobal.cxx
parent9e0ce23a03096a9a2e3ac2936ca64b8ea1fdd326 (diff)
downloadmpd-008723c62fe9686812758dfffb06d59f998f6204.tar.gz
mpd-008723c62fe9686812758dfffb06d59f998f6204.tar.xz
mpd-008723c62fe9686812758dfffb06d59f998f6204.zip
ConfigGlobal: eliminate function config_get_next_param()
Diffstat (limited to '')
-rw-r--r--src/config/ConfigGlobal.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/config/ConfigGlobal.cxx b/src/config/ConfigGlobal.cxx
index dd76e3ca3..9bc83398c 100644
--- a/src/config/ConfigGlobal.cxx
+++ b/src/config/ConfigGlobal.cxx
@@ -74,12 +74,10 @@ void config_global_check(void)
Check(p);
}
-const struct config_param *
-config_get_next_param(ConfigOption option, const struct config_param * last)
+const config_param *
+config_get_param(ConfigOption option)
{
- config_param *param = last != nullptr
- ? last->next
- : config_data.params[unsigned(option)];
+ config_param *param = config_data.params[unsigned(option)];
if (param != nullptr)
param->used = true;
return param;
@@ -88,8 +86,8 @@ config_get_next_param(ConfigOption option, const struct config_param * last)
const config_param *
config_find_block(ConfigOption option, const char *key, const char *value)
{
- const config_param *param = nullptr;
- while ((param = config_get_next_param(option, param)) != nullptr) {
+ for (const config_param *param = config_get_param(option);
+ param != nullptr; param = param->next) {
const char *value2 = param->GetBlockValue(key);
if (value2 == nullptr)
FormatFatalError("block without '%s' name in line %d",