From a770b4a4a80189bc45b6bbc947c654d03ba40e7a Mon Sep 17 00:00:00 2001 From: Jason Yundt Date: Sat, 18 Feb 2023 07:31:27 -0500 Subject: [PATCH] Simplify update-authors.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before this change, there was effectively two for loops, one for the list comprehension and one to iterate over the resulting list. Generating the list wasn’t necessary since the code would just immediately iterate over the list after it was generated, and then never do anything with the list ever again. --- update-authors.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/update-authors.py b/update-authors.py index 954cc2efb..dfeab0dcd 100755 --- a/update-authors.py +++ b/update-authors.py @@ -7,10 +7,9 @@ git_log = subprocess.check_output(['git', 'shortlog', '--summary', '--email']) log_entries = git_log.decode('utf-8').strip().split('\n') -authors = [author_re.search(entry).group(0) for entry in log_entries] print("Galaxy has been contribued to by the following authors:\n" "This list is automatically generated - please file an issue for corrections)\n") -for author in authors: - print(author) +for entry in log_entries: + print(author_re.search(entry).group(0))