Skip to content

Commit

Permalink
[CM] Linting if/else statements
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl committed Dec 11, 2023
1 parent 345e70f commit d05137d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion controller_manager/src/controller_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2443,7 +2443,10 @@ bool ControllerManager::controller_sorting(
if (!((is_controller_active(ctrl_a.c) || is_controller_inactive(ctrl_a.c)) &&
(is_controller_active(ctrl_b.c) || is_controller_inactive(ctrl_b.c))))
{
if (is_controller_active(ctrl_a.c) || is_controller_inactive(ctrl_a.c)) return true;
if (is_controller_active(ctrl_a.c) || is_controller_inactive(ctrl_a.c))
{
return true;
}
return false;
}

Expand All @@ -2455,9 +2458,13 @@ bool ControllerManager::controller_sorting(
// 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;
}
}
else if (ctrl_b.c->command_interface_configuration().names.empty() || !ctrl_b.c->is_chainable())
{
Expand All @@ -2472,7 +2479,9 @@ bool ControllerManager::controller_sorting(
if (
std::find(following_ctrls.begin(), following_ctrls.end(), ctrl_b.info.name) !=
following_ctrls.end())
{
return true;
}
else
{
auto ctrl_a_preceding_ctrls = get_preceding_controller_names(ctrl_a.info.name, controllers);
Expand Down

0 comments on commit d05137d

Please sign in to comment.