From 3ffb34257acdd58ec8929bf7ec7d5bd2567be334 Mon Sep 17 00:00:00 2001 From: Felix Yan Date: Thu, 24 Sep 2020 16:13:30 +0800 Subject: [PATCH] Use list comprehension instead of map lambda --- nvchecker_source/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nvchecker_source/git.py b/nvchecker_source/git.py index 89e0b6d..2f70104 100644 --- a/nvchecker_source/git.py +++ b/nvchecker_source/git.py @@ -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