Skip to content
Snippets Groups Projects
Commit bcd3540a authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[BL] ConfigTree; Constness and references.

parent 235d820e
No related branches found
No related tags found
No related merge requests found
...@@ -49,9 +49,9 @@ void ConfigTreeTopLevel::checkAndInvalidate() ...@@ -49,9 +49,9 @@ void ConfigTreeTopLevel::checkAndInvalidate()
template <typename T> template <typename T>
void traverse_recursive( void traverse_recursive(
boost::property_tree::ptree& parent, boost::property_tree::ptree& parent,
const boost::property_tree::ptree::path_type& child_path, boost::property_tree::ptree::path_type const& child_path,
boost::property_tree::ptree& child, boost::property_tree::ptree& child,
const fs::path bench_dir, fs::path const& bench_dir,
T& method) T& method)
{ {
using boost::property_tree::ptree; using boost::property_tree::ptree;
...@@ -59,7 +59,7 @@ void traverse_recursive( ...@@ -59,7 +59,7 @@ void traverse_recursive(
method(parent, child_path, child, bench_dir); method(parent, child_path, child, bench_dir);
for (auto& [key, tree] : child) for (auto& [key, tree] : child)
{ {
ptree::path_type cur_path = child_path / ptree::path_type(key); ptree::path_type const cur_path = child_path / ptree::path_type(key);
traverse_recursive(child, cur_path, tree, bench_dir, method); traverse_recursive(child, cur_path, tree, bench_dir, method);
} }
} }
...@@ -72,10 +72,10 @@ void traverse(boost::property_tree::ptree& parent, const fs::path bench_dir, ...@@ -72,10 +72,10 @@ void traverse(boost::property_tree::ptree& parent, const fs::path bench_dir,
} }
void replace_includes( void replace_includes(
[[maybe_unused]] const boost::property_tree::ptree& parent, [[maybe_unused]] boost::property_tree::ptree const& parent,
[[maybe_unused]] const boost::property_tree::ptree::path_type& child_path, [[maybe_unused]] boost::property_tree::ptree::path_type const& child_path,
boost::property_tree::ptree& child, boost::property_tree::ptree& child,
const fs::path bench_dir) fs::path const& bench_dir)
{ {
using boost::property_tree::ptree; using boost::property_tree::ptree;
for (auto& [key, tree] : child) for (auto& [key, tree] : child)
...@@ -83,8 +83,8 @@ void replace_includes( ...@@ -83,8 +83,8 @@ void replace_includes(
if (key == "include") if (key == "include")
{ {
auto filename = tree.get<std::string>("<xmlattr>.file"); auto filename = tree.get<std::string>("<xmlattr>.file");
auto filepath = fs::path(filename); if (auto const filepath = fs::path(filename);
if (filepath.is_relative()) filepath.is_relative())
{ {
filename = (bench_dir / filepath).string(); filename = (bench_dir / filepath).string();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment