From 7d599c1afc01324fb143a056e4116fc596cb7e42 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Wed, 29 May 2019 22:22:05 +0200 Subject: [PATCH] Main: add Config constructor --- src/Main.cxx | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Main.cxx b/src/Main.cxx index 2b3682507..7adf42689 100644 --- a/src/Main.cxx +++ b/src/Main.cxx @@ -133,13 +133,10 @@ Instance *global_instance; struct Config { ReplayGainConfig replay_gain; -}; -static Config -LoadConfig(const ConfigData &config) -{ - return {LoadReplayGainConfig(config)}; -} + explicit Config(const ConfigData &raw) + :replay_gain(LoadReplayGainConfig(raw)) {} +}; #ifdef ENABLE_DAEMON @@ -391,7 +388,7 @@ MainConfigured(const struct options &options, const ConfigData &raw_config) #endif InitPathParser(raw_config); - const auto config = LoadConfig(raw_config); + const Config config(raw_config); #ifdef ENABLE_DAEMON glue_daemonize_init(&options, raw_config);