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:
parent
4c55947c47
commit
0a6e485d92
|
@ -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…
Reference in New Issue