aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2019-04-11 12:21:34 -0700
committerJussi Pakkanen <jpakkane@gmail.com>2019-04-12 00:24:51 +0300
commit00a3bb8d695a99be2c05d14985341f014a299e46 (patch)
tree693c89beb563872e8b0b2cb78296ee006a27bd73
parent2499e2547656f244ba654db7208f5453d6b53eff (diff)
downloadmeson-00a3bb8d695a99be2c05d14985341f014a299e46.zip
meson-00a3bb8d695a99be2c05d14985341f014a299e46.tar.gz
meson-00a3bb8d695a99be2c05d14985341f014a299e46.tar.bz2
interpreter: use zip function
Currently this is implemented as range(min(len(a), len(b)), an then indexing into a and b to get what we actually want. Fortunately python provides a function called zip that just does this.
-rw-r--r--mesonbuild/interpreter.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py
index 4b713ea..b945011 100644
--- a/mesonbuild/interpreter.py
+++ b/mesonbuild/interpreter.py
@@ -2278,9 +2278,7 @@ external dependencies (including libraries) must go to "dependencies".''')
if argcount != len(args):
raise InvalidArguments('Expected %d arguments, got %d.' %
(argcount, len(args)))
- for i in range(min(len(args), len(arg_types))):
- wanted = arg_types[i]
- actual = args[i]
+ for actual, wanted in zip(args, arg_types):
if wanted is not None:
if not isinstance(actual, wanted):
raise InvalidArguments('Incorrect argument type.')