Skip to content

Commit

Permalink
Rename lambda method for clarity.
Browse files Browse the repository at this point in the history
Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Sai Kishor Kothakota <[email protected]>
  • Loading branch information
3 people authored Jan 9, 2024
1 parent 77884b9 commit 80ef781
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hardware_interface/src/resource_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,7 @@ bool ResourceManager::prepare_command_mode_switch(
return false;
}

auto call_method_on_components =
auto call_prepare_mode_switch =
[&start_interfaces, &stop_interfaces, &interfaces_to_string](auto & components)
{
bool ret = true;
Expand All @@ -1172,8 +1172,8 @@ bool ResourceManager::prepare_command_mode_switch(
return ret;
};

const bool actuators_result = call_method_on_components(resource_storage_->actuators_);
const bool systems_result = call_method_on_components(resource_storage_->systems_);
const bool actuators_result = call_prepare_mode_switch(resource_storage_->actuators_);
const bool systems_result = call_prepare_mode_switch(resource_storage_->systems_);

return actuators_result && systems_result;
}
Expand All @@ -1189,7 +1189,7 @@ bool ResourceManager::perform_command_mode_switch(
return true;
}

auto call_method_on_components = [&start_interfaces, &stop_interfaces](auto & components)
auto call_perform_mode_switch = [&start_interfaces, &stop_interfaces](auto & components)
{
bool ret = true;
for (auto & component : components)
Expand All @@ -1212,8 +1212,8 @@ bool ResourceManager::perform_command_mode_switch(
return ret;
};

const bool actuators_result = call_method_on_components(resource_storage_->actuators_);
const bool systems_result = call_method_on_components(resource_storage_->systems_);
const bool actuators_result = call_perform_mode_switch(resource_storage_->actuators_);
const bool systems_result = call_perform_mode_switch(resource_storage_->systems_);

return actuators_result && systems_result;
}
Expand Down

0 comments on commit 80ef781

Please sign in to comment.