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:
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue