config/Data: use std::forward_list to manage params and blocks

This commit is contained in:
Max Kellermann
2018-07-18 11:03:19 +02:00
parent fd80683ade
commit 9ff2606bb8
11 changed files with 85 additions and 116 deletions

View File

@@ -53,17 +53,16 @@ void
NeighborGlue::Init(const ConfigData &config,
EventLoop &loop, NeighborListener &listener)
{
for (const auto *block = config.GetBlock(ConfigBlockOption::NEIGHBORS);
block != nullptr; block = block->next) {
block->SetUsed();
for (const auto &block : config.GetBlockList(ConfigBlockOption::NEIGHBORS)) {
block.SetUsed();
try {
explorers.emplace_front(CreateNeighborExplorer(loop,
listener,
*block));
block));
} catch (...) {
std::throw_with_nested(FormatRuntimeError("Line %i: ",
block->line));
block.line));
}
}
}