summaryrefslogtreecommitdiff
path: root/mesonbuild/munstable_coredata.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2022-09-07 14:59:47 -0700
committerEli Schwartz <eschwartz@archlinux.org>2022-11-30 16:23:29 -0500
commit2d349eae8cb6f1f3b61838dca7cc989e9278be28 (patch)
treebc8d6325543e0df74b16941996f07797a746a2f6 /mesonbuild/munstable_coredata.py
parent50f35039e7df321a309ee45db57d37635bf53ce3 (diff)
downloadmeson-2d349eae8cb6f1f3b61838dca7cc989e9278be28.tar.gz
pylint: enable the set_membership plugin
Which adds the `use-set-for-membership` check. It's generally faster in python to use a set with the `in` keyword, because it's a hash check instead of a linear walk, this is especially true with strings, where it's actually O(n^2), one loop over the container, and an inner loop of the strings (as string comparison works by checking that `a[n] == b[n]`, in a loop). Also, I'm tired of complaining about this in reviews, let the tools do it for me :)
Diffstat (limited to 'mesonbuild/munstable_coredata.py')
-rw-r--r--mesonbuild/munstable_coredata.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/mesonbuild/munstable_coredata.py b/mesonbuild/munstable_coredata.py
index 49e053005..fa3b720e3 100644
--- a/mesonbuild/munstable_coredata.py
+++ b/mesonbuild/munstable_coredata.py
@@ -61,17 +61,17 @@ def run(options):
coredata = cdata.load(options.builddir)
backend = coredata.get_option(OptionKey('backend'))
for k, v in sorted(coredata.__dict__.items()):
- if k in ('backend_options', 'base_options', 'builtins', 'compiler_options', 'user_options'):
+ if k in {'backend_options', 'base_options', 'builtins', 'compiler_options', 'user_options'}:
# use `meson configure` to view these
pass
- elif k in ['install_guid', 'test_guid', 'regen_guid']:
+ elif k in {'install_guid', 'test_guid', 'regen_guid'}:
if all_backends or backend.startswith('vs'):
print(k + ': ' + v)
elif k == 'target_guids':
if all_backends or backend.startswith('vs'):
print(k + ':')
dump_guids(v)
- elif k in ['lang_guids']:
+ elif k == 'lang_guids':
if all_backends or backend.startswith('vs') or backend == 'xcode':
print(k + ':')
dump_guids(v)