Skip to content

Commit

Permalink
Avoid needlessly reinstantiating Prepareds.
Browse files Browse the repository at this point in the history
  • Loading branch information
anntzer committed Jan 10, 2021
1 parent b3a72a1 commit c1af1d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion importlib_metadata/__init__.py
Expand Up @@ -565,8 +565,9 @@ def find_distributions(self, context=DistributionFinder.Context()):
@classmethod
def _search_paths(cls, name, paths):
"""Find metadata directories in paths heuristically."""
prepared = Prepared(name)
return itertools.chain.from_iterable(
path.search(Prepared(name)) for path in map(FastPath, paths)
path.search(prepared) for path in map(FastPath, paths)
)


Expand Down

0 comments on commit c1af1d6

Please sign in to comment.