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.
This commit is contained in:
Eli Schwartz 2023-02-01 16:52:26 -05:00
parent 4c55947c47
commit 0a6e485d92
No known key found for this signature in database
GPG Key ID: CEB167EFB5722BD6
1 changed files with 1 additions and 3 deletions

View File

@ -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;