Skip to content

Commit c1af1d6

Browse files
committed
Avoid needlessly reinstantiating Prepareds.
1 parent b3a72a1 commit c1af1d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

importlib_metadata/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,8 +565,9 @@ def find_distributions(self, context=DistributionFinder.Context()):
565565
@classmethod
566566
def _search_paths(cls, name, paths):
567567
"""Find metadata directories in paths heuristically."""
568+
prepared = Prepared(name)
568569
return itertools.chain.from_iterable(
569-
path.search(Prepared(name)) for path in map(FastPath, paths)
570+
path.search(prepared) for path in map(FastPath, paths)
570571
)
571572

572573

0 commit comments

Comments
 (0)