From 00a3bb8d695a99be2c05d14985341f014a299e46 Mon Sep 17 00:00:00 2001 From: Dylan Baker Date: Thu, 11 Apr 2019 12:21:34 -0700 Subject: 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. --- mesonbuild/interpreter.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'mesonbuild') diff --git a/mesonbuild/interpreter.py b/mesonbuild/interpreter.py index 4b713ea00..b945011f2 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.') -- cgit v1.2.3