From 4e24b1dbf4484250c051adeb280dcc74c04a6d8f Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Wed, 1 Feb 2023 16:52:26 -0500 Subject: 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 ed485d2..d44dd4d 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; -- cgit v1.1