Skip to content

Commit

Permalink
replace 'auto' to 'const auto &' (#630)
Browse files Browse the repository at this point in the history
Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
  • Loading branch information
youtalk authored and wjwwood committed Feb 13, 2019
1 parent 4046563 commit 10d7b7c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions rclcpp/src/rclcpp/node_interfaces/node_parameters.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ NodeParameters::set_parameters(
const std::vector<rclcpp::Parameter> & parameters)
{
std::vector<rcl_interfaces::msg::SetParametersResult> results;
for (auto p : parameters) {
for (const auto & p : parameters) {
auto result = set_parameters_atomically({{p}});
results.push_back(result);
}
Expand Down Expand Up @@ -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"
Expand All @@ -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());
}
Expand Down

0 comments on commit 10d7b7c

Please sign in to comment.