From 51b8985400b10adb3fdd9f1851f368713def54eb Mon Sep 17 00:00:00 2001 From: "Dr. Denis" Date: Tue, 12 Dec 2023 13:11:35 +0100 Subject: [PATCH] [CM] Linting if/else statements (#1193) --- controller_manager/src/controller_manager.cpp | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/controller_manager/src/controller_manager.cpp b/controller_manager/src/controller_manager.cpp index b79f122c6b..da7815d51e 100644 --- a/controller_manager/src/controller_manager.cpp +++ b/controller_manager/src/controller_manager.cpp @@ -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()) {