parse_repo: iterate over tar object

this is ~20% faster compared to calling getmembers()
This commit is contained in:
Christoph Reiter
2021-11-27 09:48:45 +01:00
parent 09cbac7fb0
commit e8aa409ced

View File

@@ -134,7 +134,7 @@ async def parse_repo(repo: str, repo_variant: str, files_url: str, download_url:
with io.BytesIO(data) as f:
with ExtTarFile.open(fileobj=f, mode="r") as tar:
packages: Dict[str, list] = {}
for info in tar.getmembers():
for info in tar:
package_name = info.name.split("/", 1)[0]
infofile = tar.extractfile(info)
if infofile is None: