Commit 5a2b441a authored by Stefan Behnel's avatar Stefan Behnel

avoid minor redundancy in generated code

parent 55eb49a4
...@@ -2021,10 +2021,11 @@ class DefNode(FuncDefNode): ...@@ -2021,10 +2021,11 @@ class DefNode(FuncDefNode):
elif min_positional_args == max_positional_args: elif min_positional_args == max_positional_args:
# parse the exact number of positional arguments from the # parse the exact number of positional arguments from the
# args tuple # args tuple
code.putln('} else {') if max_positional_args > 0:
for i, arg in enumerate(positional_args): code.putln('} else {')
item = "PyTuple_GET_ITEM(%s, %d)" % (Naming.args_cname, i) for i, arg in enumerate(positional_args):
self.generate_arg_assignment(arg, item, code) item = "PyTuple_GET_ITEM(%s, %d)" % (Naming.args_cname, i)
self.generate_arg_assignment(arg, item, code)
else: else:
# parse the positional arguments from the variable length # parse the positional arguments from the variable length
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment