From 10d7b7c72bc243e4e6da0546f9d17e39460df55c Mon Sep 17 00:00:00 2001 From: Yutaka Kondo Date: Wed, 13 Feb 2019 11:02:29 +0900 Subject: [PATCH] replace 'auto' to 'const auto &' (#630) Signed-off-by: Yutaka Kondo --- rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp b/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp index 37588b2b31..8c4d14b94c 100644 --- a/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp +++ b/rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp @@ -177,7 +177,7 @@ NodeParameters::set_parameters( const std::vector & parameters) { std::vector results; - for (auto p : parameters) { + for (const auto & p : parameters) { auto result = set_parameters_atomically({{p}}); results.push_back(result); } @@ -206,7 +206,7 @@ NodeParameters::set_parameters_atomically( return result; } - for (auto p : parameters) { + for (const auto & p : parameters) { if (p.get_type() == rclcpp::ParameterType::PARAMETER_NOT_SET) { if (parameters_.find(p.get_name()) != parameters_.end()) { // case: parameter was set before, and input is "NOT_SET" @@ -229,7 +229,7 @@ NodeParameters::set_parameters_atomically( tmp_map.insert(parameters_.begin(), parameters_.end()); // remove explicitly deleted parameters - for (auto p : parameters) { + for (const auto & p : parameters) { if (p.get_type() == rclcpp::ParameterType::PARAMETER_NOT_SET) { tmp_map.erase(p.get_name()); }