Skip to content

Commit 02b3836

Browse files
authored
Get rid of unnecessary checks in composable_node_container. (#364)
valid_composable_nodes is a local variable that we know is a list. So we can just do the idiomatic Python thing and check with a simple "if" statement. This is also faster. Signed-off-by: Chris Lalancette <[email protected]>
1 parent d2a7128 commit 02b3836

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

launch_ros/launch_ros/actions/composable_node_container.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,7 @@ def execute(self, context: LaunchContext) -> Optional[List[Action]]:
8585
if node_object.condition() is None or node_object.condition().evaluate(context):
8686
valid_composable_nodes.append(node_object)
8787

88-
if (
89-
valid_composable_nodes is not None and
90-
len(valid_composable_nodes) > 0
91-
):
88+
if valid_composable_nodes:
9289
from .load_composable_nodes import LoadComposableNodes
9390
# Perform load action once the container has started.
9491
load_actions = [

0 commit comments

Comments
 (0)