diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2023-02-01 16:52:26 -0500 |
---|---|---|
committer | Nirbheek Chauhan <nirbheek@centricular.com> | 2023-02-06 23:42:44 +0530 |
commit | 4e24b1dbf4484250c051adeb280dcc74c04a6d8f (patch) | |
tree | 26b2565795c6f979d1ce3f0bcfcee9b4cbbe259c /mesonbuild/compilers/mixins | |
parent | 0aa32114ce1cf5e627499b3546d7c2e345e6bbe3 (diff) | |
download | meson-4e24b1dbf4484250c051adeb280dcc74c04a6d8f.zip meson-4e24b1dbf4484250c051adeb280dcc74c04a6d8f.tar.gz meson-4e24b1dbf4484250c051adeb280dcc74c04a6d8f.tar.bz2 |
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.
Diffstat (limited to 'mesonbuild/compilers/mixins')
-rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index ed485d2..d44dd4d 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -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; |