From 0a6e485d92907dbaba8301a29335900501513621 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 1 Feb 2023 16:52:26 -0500 Subject: [PATCH] pylint 2.16: join iterables without repeated append We do += style joining in a loop, but we could just join with `''.join()` which is faster, neater, and simpler. --- mesonbuild/compilers/mixins/clike.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index ed485d261..d44dd4dfa 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -882,9 +882,7 @@ class CLikeCompiler(Compiler): if extra_args is None: extra_args = [] # Create code that accesses all members - members = '' - for member in membernames: - members += f'foo.{member};\n' + members = ''.join(f'foo.{member};\n' for member in membernames) t = f'''{prefix} void bar(void) {{ {typename} foo;