aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/cmake/common.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-09-07 15:23:42 -0700
committerEli Schwartz <eschwartz@archlinux.org>2022-10-04 00:33:04 -0400
commita72840cd2e27bf18b88cf95ef6a9e5e3ab05427d (patch)
treec3e6ce969bd01ae144f14213dd591e022c453019 /mesonbuild/cmake/common.py
parentf11ebf20ff51dc1e9d6aa07fea64bc891869e48a (diff)
downloadmeson-a72840cd2e27bf18b88cf95ef6a9e5e3ab05427d.zip
meson-a72840cd2e27bf18b88cf95ef6a9e5e3ab05427d.tar.gz
meson-a72840cd2e27bf18b88cf95ef6a9e5e3ab05427d.tar.bz2
pylint: enable use-a-generator
This catches some optimization problems, mostly in the use of `all()` and `any()`. Basically writing `any([x == 5 for x in f])` vs `any(x == 5 for x in f)` reduces the performance because the entire concrete list must first be created, then iterated over, while in the second f is iterated and checked element by element.
Diffstat (limited to 'mesonbuild/cmake/common.py')
-rw-r--r--mesonbuild/cmake/common.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/cmake/common.py b/mesonbuild/cmake/common.py
index 60764cc..7c05a2b 100644
--- a/mesonbuild/cmake/common.py
+++ b/mesonbuild/cmake/common.py
@@ -151,7 +151,7 @@ def check_cmake_args(args: T.List[str]) -> T.List[str]:
dis = ['-D' + x for x in blacklist_cmake_defs]
assert dis # Ensure that dis is not empty.
for i in args:
- if any([i.startswith(x) for x in dis]):
+ if any(i.startswith(x) for x in dis):
mlog.warning('Setting', mlog.bold(i), 'is not supported. See the meson docs for cross compilation support:')
mlog.warning(' - URL: https://mesonbuild.com/CMake-module.html#cross-compilation')
mlog.warning(' --> Ignoring this option')