aboutsummaryrefslogtreecommitdiff
path: root/mesonbuild/scripts/gtkdochelper.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/scripts/gtkdochelper.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/scripts/gtkdochelper.py')
-rw-r--r--mesonbuild/scripts/gtkdochelper.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/mesonbuild/scripts/gtkdochelper.py b/mesonbuild/scripts/gtkdochelper.py
index 01ced5b..11d31b6 100644
--- a/mesonbuild/scripts/gtkdochelper.py
+++ b/mesonbuild/scripts/gtkdochelper.py
@@ -175,7 +175,7 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
mkdb_cmd.append('--name-space=' + namespace)
if modeflag:
mkdb_cmd.append(modeflag)
- if len(main_file) > 0:
+ if main_file:
# Yes, this is the flag even if the file is in xml.
mkdb_cmd.append('--main-sgml-file=' + main_file)
# Add user-specified arguments
@@ -187,7 +187,7 @@ def build_gtkdoc(source_root, build_root, doc_subdir, src_subdirs,
'--path=' + ':'.join((doc_src, abs_out)),
module,
] + html_args
- if len(main_file) > 0:
+ if main_file:
mkhtml_cmd.append('../' + main_file)
else:
mkhtml_cmd.append('%s-docs.xml' % module)
@@ -212,23 +212,23 @@ def install_gtkdoc(build_root, doc_subdir, install_prefix, datadir, module):
def run(args):
options = parser.parse_args(args)
- if len(options.htmlargs) > 0:
+ if options.htmlargs:
htmlargs = options.htmlargs.split('@@')
else:
htmlargs = []
- if len(options.scanargs) > 0:
+ if options.scanargs:
scanargs = options.scanargs.split('@@')
else:
scanargs = []
- if len(options.scanobjsargs) > 0:
+ if options.scanobjsargs:
scanobjsargs = options.scanobjsargs.split('@@')
else:
scanobjsargs = []
- if len(options.fixxrefargs) > 0:
+ if options.fixxrefargs:
fixxrefargs = options.fixxrefargs.split('@@')
else:
fixxrefargs = []
- if len(options.mkdbargs) > 0:
+ if options.mkdbargs:
mkdbargs = options.mkdbargs.split('@@')
else:
mkdbargs = []