launch
launch copied to clipboard
_prune_and_count iterating over collection twice
In launch_service.py, the methods LaunchService._prune_and_count_entity_future_pairs() and LaunchService._prune_and_count_context_completion_futures() perform an unneeded scan through their respective containers just to decide if another scan (using the exact same check) is needed to prune their respective containers (LaunchService._entity_future_pairs and LaunchService.__context.._completion_futures)
I am not sure if this would cause any issues with the launch process, but it looks a bit odd. If there are a lot of elements in either of the collections, it could conceivably be the cause of a slowdown.