Skip to content

Commit

Permalink
pylint 2.16: join iterables without repeated append
Browse files Browse the repository at this point in the history
We do += style joining in a loop, but we could just join with
`''.join()` which is faster, neater, and simpler.
  • Loading branch information
Eli Schwartz committed Feb 1, 2023
1 parent 4c55947 commit 0a6e485
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions mesonbuild/compilers/mixins/clike.py
Original file line number Diff line number Diff line change
Expand Up @@ -882,9 +882,7 @@ def has_members(self, typename: str, membernames: T.List[str],
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;
Expand Down

0 comments on commit 0a6e485

Please sign in to comment.