From bb413524046e46b65162c4248a3fe2979d3b1c06 Mon Sep 17 00:00:00 2001 From: correctmost <134317971+correctmost@users.noreply.github.com> Date: Fri, 9 Aug 2024 04:41:43 -0400 Subject: [PATCH] Use list comprehensions to avoid append() calls This provides a small speed-up on large codebases. --- pycodestyle.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pycodestyle.py b/pycodestyle.py index c4c8dbaa..3d32b581 100755 --- a/pycodestyle.py +++ b/pycodestyle.py @@ -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):