Skip to content

Commit

Permalink
Use list comprehensions to avoid append() calls
Browse files Browse the repository at this point in the history
This provides a small speed-up on large codebases.
  • Loading branch information
correctmost committed Aug 9, 2024
1 parent 3d5962b commit bb41352
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions pycodestyle.py
Original file line number Diff line number Diff line change
Expand Up @@ -1910,9 +1910,7 @@ def readline(self):

def run_check(self, check, argument_names):
"""Run a check plugin."""
arguments = []
for name in argument_names:
arguments.append(getattr(self, name))
arguments = [getattr(self, name) for name in argument_names]
return check(*arguments)

def init_checker_state(self, name, argument_names):
Expand Down

0 comments on commit bb41352

Please sign in to comment.