Skip to content

Commit

Permalink
refactor: Don't sort inventories when reading them, it's useless
Browse files Browse the repository at this point in the history
  • Loading branch information
pawamoy committed Sep 2, 2023
1 parent 9397460 commit 3ed3453
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mkdocstrings/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ def parse_sphinx(cls, in_file: BinaryIO, *, domain_filter: Collection[str] = ())
domain_filter: A collection of domain values to allow (and filter out all other ones).
Returns:
An `Inventory` containing the collected `InventoryItem`s.
An inventory containing the collected items.
"""
for _ in range(4):
in_file.readline()
lines = zlib.decompress(in_file.read()).splitlines()
items = [InventoryItem.parse_sphinx(line.decode("utf8")) for line in lines]
if domain_filter:
items = [item for item in items if item.domain in domain_filter]
return cls(sorted(items, key=lambda item: (item.domain, item.name)))
return cls(items)

0 comments on commit 3ed3453

Please sign in to comment.