1
0
mirror of https://github.com/django/django.git synced 2025-04-06 06:26:41 +00:00

Wrap generator expression in join() with list comprehension for a slight performance increase

https://stackoverflow.com/a/9061024/1726238
https://github.com/adamchainz/flake8-comprehensions/issues/156#issuecomment-2459089173
This commit is contained in:
Ülgen Sarıkavak 2024-11-21 19:15:35 +03:00
parent 9ea49f9707
commit df010ca100

View File

@ -202,7 +202,7 @@ class Command(BaseCommand):
formatted_str.write("\n")
# Header - content separator
formatted_str.write("-+-".join("-" * width for width in widths))
formatted_str.write("-+-".join(["-" * width for width in widths]))
formatted_str.write("\n")
# Rows (content)
@ -258,7 +258,7 @@ class Command(BaseCommand):
separator,
)
formatted_str.write("\n".join(part for part in parts if part))
formatted_str.write("\n".join([part for part in parts if part]))
return formatted_str.getvalue()