From: Stefan Behnel Date: Sun, 28 Dec 2008 15:50:18 +0000 (+0100) Subject: avoid minor redundancy in generated code X-Git-Tag: 0.11-beta~71 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=55eb49a4ab8043b665c6a2bbbc51ccb5e481c68c;p=cython.git avoid minor redundancy in generated code --- diff --git a/Cython/Compiler/Nodes.py b/Cython/Compiler/Nodes.py index 89e12f5c..573ff938 100644 --- a/Cython/Compiler/Nodes.py +++ b/Cython/Compiler/Nodes.py @@ -2174,8 +2174,10 @@ class DefNode(FuncDefNode): code.putln('}') code.putln('if (unlikely(kw_args > 0)) {') - # non-positional kw args left in dict: default args, **kwargs or error - if self.star_arg: + # non-positional/-required kw args left in dict: default args, **kwargs or error + if max_positional_args == 0: + pos_arg_count = "0" + elif self.star_arg: code.putln("const Py_ssize_t used_pos_args = (PyTuple_GET_SIZE(%s) < %d) ? PyTuple_GET_SIZE(%s) : %d;" % ( Naming.args_cname, max_positional_args, Naming.args_cname, max_positional_args))