From 48908fb0bba69404dfd86d1af3b9ace1e0d598c9 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 15 May 2020 18:59:19 +0200 Subject: Speedup GetPath() --- plugin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'plugin.cpp') diff --git a/plugin.cpp b/plugin.cpp index 28fdb62..afcbdb3 100644 --- a/plugin.cpp +++ b/plugin.cpp @@ -64,22 +64,23 @@ void PluginLoader::load_plugins() } } +// validate config regarding plugins bool PluginLoader::validate_config() { const auto& sites{m_config.Sites()}; for (const auto& site: sites) { - for (const auto& path: site.paths) { + for (const auto& path: site.second.paths) { // path must contain target and plugin auto it {path.params.find("target")}; if (it == path.params.end()) { - std::cout << "Path " << path.requested << " for site " << site.name << " is missing target specification." << std::endl; + std::cout << "Path " << path.requested << " for site " << site.first << " is missing target specification." << std::endl; return false; } it = path.params.find("plugin"); if (it == path.params.end()) { - std::cout << "Path " << path.requested << " for site " << site.name << " is missing plugin specification." << std::endl; + std::cout << "Path " << path.requested << " for site " << site.first << " is missing plugin specification." << std::endl; return false; } -- cgit v1.2.3