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/scripts/dist.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/scripts/dist.py')
-rw-r--r-- | mesonbuild/scripts/dist.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/scripts/dist.py b/mesonbuild/scripts/dist.py index 309a032..47fde23 100644 --- a/mesonbuild/scripts/dist.py +++ b/mesonbuild/scripts/dist.py @@ -133,7 +133,7 @@ def create_dist_hg(dist_name, src_root, bld_root, dist_sub, dist_scripts): tarname = os.path.join(dist_sub, dist_name + '.tar') xzname = tarname + '.xz' subprocess.check_call(['hg', 'archive', '-R', src_root, '-S', '-t', 'tar', tarname]) - if len(dist_scripts) > 0: + if dist_scripts: mlog.warning('dist scripts are not supported in Mercurial projects') with lzma.open(xzname, 'wb') as xf, open(tarname, 'rb') as tf: shutil.copyfileobj(tf, xf) |