From 86df7dd6273498e3256f4944b6b584636ae6ffb5 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Wed, 27 Oct 2021 11:19:39 -0700 Subject: modules/gnome: don't use dict.keys() to test membership This is slower than looking in the dictionary, as the dict lookup is O(log n), while keys() is O(n). --- mesonbuild/modules/gnome.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'mesonbuild/modules/gnome.py') diff --git a/mesonbuild/modules/gnome.py b/mesonbuild/modules/gnome.py index edf8e55..ddde779 100644 --- a/mesonbuild/modules/gnome.py +++ b/mesonbuild/modules/gnome.py @@ -269,10 +269,10 @@ class GnomeModule(ExtensionModule): output = f'{target_name}.gresource' name = f'{target_name}_gresource' else: - if 'c' in state.environment.coredata.compilers.host.keys(): + if 'c' in state.environment.coredata.compilers.host: output = f'{target_name}.c' name = f'{target_name}_c' - elif 'cpp' in state.environment.coredata.compilers.host.keys(): + elif 'cpp' in state.environment.coredata.compilers.host: output = f'{target_name}.cpp' name = f'{target_name}_cpp' else: -- cgit v1.1