aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/mesonmain.py
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-04-22 15:54:16 -0700
committerDylan Baker <dylan@pnwbakers.com>2019-04-25 12:28:51 -0700
commit5678468c2cc1f4639c68a95fb71f8212c846459b (patch)
treeeeedb656ffa320932b052043355e297809b90633 /mesonbuild/mesonmain.py
parent8e1670cc60cc853c7ddc81dceb65dc93fa45bfa9 (diff)
downloadmeson-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/mesonmain.py')
-rw-r--r--mesonbuild/mesonmain.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/mesonbuild/mesonmain.py b/mesonbuild/mesonmain.py
index f80dfdd..4326c20 100644
--- a/mesonbuild/mesonmain.py
+++ b/mesonbuild/mesonmain.py
@@ -110,7 +110,7 @@ class CommandLineParser:
# If first arg is not a known command, assume user wants to run the setup
# command.
known_commands = list(self.commands.keys()) + ['-h', '--help']
- if len(args) == 0 or args[0] not in known_commands:
+ if not args or args[0] not in known_commands:
args = ['setup'] + args
# Hidden commands have their own parser instead of using the global one