mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Clean up Section in BasicConfig.h:
The following changes were made: - Removed dependency on template defined in beast detail namespace. - Removed Section::find() method which had an obsolete interface. - Made Section::get<>() easier to use for the common case of retrieving a std::string. The revised get() method replaces old calls to Section::find(). - Provided a default template parameter to free function get<>(Section config, std::string name) so it stays similar to Section::get<>(). Then the rest of the code was adapted to these changes. - Calls to Section::find() were replaced with calls to Section::get. - Unnecessary get<std::string>() arguments were reduced to get(). These changes dug up an interesting artifact in the SHAMap unit tests. I'm not sure why the tests were working before, but there was a problem with the case of a Section key. The unit test is fixed.
This commit is contained in:
committed by
manojsdoshi
parent
b9943d3746
commit
a1fd579756
@@ -671,7 +671,7 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
try
|
||||
{
|
||||
if (auto val = sec.get<std::string>("max_unknown_time"))
|
||||
if (auto val = sec.get("max_unknown_time"))
|
||||
MAX_UNKNOWN_TIME =
|
||||
seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
|
||||
}
|
||||
@@ -689,7 +689,7 @@ Config::loadFromString(std::string const& fileContents)
|
||||
|
||||
try
|
||||
{
|
||||
if (auto val = sec.get<std::string>("max_diverged_time"))
|
||||
if (auto val = sec.get("max_diverged_time"))
|
||||
MAX_DIVERGED_TIME =
|
||||
seconds{beast::lexicalCastThrow<std::uint32_t>(*val)};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user