Skip to content

Commit

Permalink
[CM] Linting if/else statements (ros-controls#1193)
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl authored Dec 12, 2023
1 parent 562f36d commit 51b8985
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2462,14 +2462,9 @@ bool ControllerManager::controller_sorting(
// The case of the controllers that don't have any command interfaces. For instance,
// joint_state_broadcaster
// If the controller b is also under the same condition, then maintain their initial order
if (ctrl_b.c->command_interface_configuration().names.empty() || !ctrl_b.c->is_chainable())
{
return false;
}
else
{
return true;
}
const auto command_interfaces_exist =
!ctrl_b.c->command_interface_configuration().names.empty();
return ctrl_b.c->is_chainable() && command_interfaces_exist;
}
else if (ctrl_b.c->command_interface_configuration().names.empty() || !ctrl_b.c->is_chainable())
{
Expand Down

0 comments on commit 51b8985

Please sign in to comment.