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.
pull/10811/head
Eli Schwartz 2 years ago
parent 4c55947c47
commit 0a6e485d92
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
  1. 4
      mesonbuild/compilers/mixins/clike.py

@ -882,9 +882,7 @@ class CLikeCompiler(Compiler):
if extra_args is None: if extra_args is None:
extra_args = [] extra_args = []
# Create code that accesses all members # Create code that accesses all members
members = '' members = ''.join(f'foo.{member};\n' for member in membernames)
for member in membernames:
members += f'foo.{member};\n'
t = f'''{prefix} t = f'''{prefix}
void bar(void) {{ void bar(void) {{
{typename} foo; {typename} foo;

Loading…
Cancel
Save