Rearrange the configuration options

This commit is contained in:
Robbert van der Helm
2021-04-27 17:54:46 +02:00
parent b52362e698
commit 38abdbee50
2 changed files with 17 additions and 16 deletions
+7 -7
View File
@@ -78,7 +78,13 @@ Configuration::Configuration(const fs::path& config_path,
// their defaults. At this point I'd really wish C++ could do pattern
// matching.
for (const auto& [key, value] : table) {
if (key == "cache_time_info") {
if (key == "group") {
if (const auto parsed_value = value.as_string()) {
group = parsed_value->get();
} else {
invalid_options.push_back(key);
}
} else if (key == "cache_time_info") {
if (const auto parsed_value = value.as_boolean()) {
cache_time_info = parsed_value->get();
} else {
@@ -113,12 +119,6 @@ Configuration::Configuration(const fs::path& config_path,
} else {
invalid_options.push_back(key);
}
} else if (key == "group") {
if (const auto parsed_value = value.as_string()) {
group = parsed_value->get();
} else {
invalid_options.push_back(key);
}
} else if (key == "vst3_no_scaling") {
if (const auto parsed_value = value.as_boolean()) {
vst3_no_scaling = parsed_value->get();