diff options
author | Dylan Baker <dylan@pnwbakers.com> | 2019-04-22 15:54:16 -0700 |
---|---|---|
committer | Dylan Baker <dylan@pnwbakers.com> | 2019-04-25 12:28:51 -0700 |
commit | 5678468c2cc1f4639c68a95fb71f8212c846459b (patch) | |
tree | eeedb656ffa320932b052043355e297809b90633 /mesonbuild/dependencies/boost.py | |
parent | 8e1670cc60cc853c7ddc81dceb65dc93fa45bfa9 (diff) | |
download | meson-5678468c2cc1f4639c68a95fb71f8212c846459b.zip meson-5678468c2cc1f4639c68a95fb71f8212c846459b.tar.gz meson-5678468c2cc1f4639c68a95fb71f8212c846459b.tar.bz2 |
Don't use len() to test for container emptiness
I ran the numbers once before (it's in the meson history) but it's
*much* faster to *not* use len for testing if a container is empty or
not.
Diffstat (limited to 'mesonbuild/dependencies/boost.py')
-rw-r--r-- | mesonbuild/dependencies/boost.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mesonbuild/dependencies/boost.py b/mesonbuild/dependencies/boost.py index 62a652a..381824c 100644 --- a/mesonbuild/dependencies/boost.py +++ b/mesonbuild/dependencies/boost.py @@ -209,7 +209,7 @@ class BoostDependency(ExternalDependency): for root in self.boost_roots: globtext = os.path.join(root, 'include', 'boost-*') incdirs = glob.glob(globtext) - if len(incdirs) > 0: + if incdirs: return incdirs[0] incboostdir = os.path.join(root, 'include', 'boost') if os.path.isdir(incboostdir): @@ -427,7 +427,7 @@ class BoostDependency(ExternalDependency): for entry in globber2_matches: fname = os.path.basename(entry) self.lib_modules[self.modname_from_filename(fname)] = [fname] - if len(globber2_matches) == 0: + if not globber2_matches: # FIXME - why are we only looking for *.lib? Mingw provides *.dll.a and *.a for entry in glob.glob(os.path.join(self.libdir, globber1 + '.lib')): if self.static: |