launch icon indicating copy to clipboard operation
launch copied to clipboard

_prune_and_count iterating over collection twice

Open jhdcs opened this issue 6 years ago • 0 comments

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.

jhdcs avatar Aug 15 '19 20:08 jhdcs