diff options
author | Max Kellermann <max@musicpd.org> | 2020-10-08 19:57:00 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2020-10-08 20:30:33 +0200 |
commit | 27cc7b352d54b013e04c6e2b66b7ff0ab6e6bfb8 (patch) | |
tree | 9b2064404927d448ba8733dc70f726726221f24a /src/config/Data.hxx | |
parent | d64729065e845ed5341ead94623f4a25e3ab1f33 (diff) |
config/Data: cast to std::chrono::steady_clock::duration properly
Oh no, 3413d1bf23a was broken! Instead of passing a number as
"seconds" to the duration constructor, it just abused the duration
constructor as cast operator, which caused custom state_file_interval
settings to be extremely short.
Diffstat (limited to 'src/config/Data.hxx')
-rw-r--r-- | src/config/Data.hxx | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/src/config/Data.hxx b/src/config/Data.hxx index 4ba918667..aab590cfc 100644 --- a/src/config/Data.hxx +++ b/src/config/Data.hxx @@ -78,22 +78,14 @@ struct ConfigData { std::chrono::steady_clock::duration GetUnsigned(ConfigOption option, - std::chrono::steady_clock::duration default_value) const { - // TODO: allow unit suffixes - auto u = GetUnsigned(option, default_value.count()); - return std::chrono::steady_clock::duration(u); - } + std::chrono::steady_clock::duration default_value) const; unsigned GetPositive(ConfigOption option, unsigned default_value) const; std::chrono::steady_clock::duration GetPositive(ConfigOption option, - std::chrono::steady_clock::duration default_value) const { - // TODO: allow unit suffixes - auto u = GetPositive(option, default_value.count()); - return std::chrono::steady_clock::duration(u); - } + std::chrono::steady_clock::duration default_value) const; bool GetBool(ConfigOption option, bool default_value) const; |