Use list comprehension instead of map lambda

This commit is contained in:
Felix Yan 2020-09-24 16:13:30 +08:00
parent 7213d84056
commit 3ffb34257a
No known key found for this signature in database
GPG Key ID: 786C63F330D7CB92
1 changed files with 1 additions and 1 deletions

View File

@ -9,5 +9,5 @@ async def get_version(
git = conf['git']
cmd = f"git ls-remote -t --refs {git}"
data = await cache.get(cmd, run_cmd)
versions = list(map(lambda line: line.split("refs/tags/")[1], data.split("\n")))
versions = [line.split("refs/tags/")[1] for line in data.splitlines()]
return versions