Commit f1f4debb authored by Stefan Behnel's avatar Stefan Behnel

drop redundant type checks in PyEval_CallObjectWithKeywords() in favour of the...

drop redundant type checks in PyEval_CallObjectWithKeywords() in favour of the simpler and faster PyObject_Call()

--HG--
extra : transplant_source : %05%05%B3.Ly1%1C%E8%ED%D8%C2m%2B%7F%C7%05%08z%04
parent 5d5e3576
......@@ -3775,19 +3775,16 @@ class GeneralCallNode(CallNode):
def generate_result_code(self, code):
if self.type.is_error: return
if not self.keyword_args:
call_code = "PyObject_Call(%s, %s, NULL)" % (
self.function.py_result(),
self.positional_args.py_result())
if self.keyword_args:
kwargs = self.keyword_args.py_result()
else:
call_code = "PyEval_CallObjectWithKeywords(%s, %s, %s)" % (
self.function.py_result(),
self.positional_args.py_result(),
self.keyword_args.py_result())
kwargs = 'NULL'
code.putln(
"%s = %s; %s" % (
"%s = PyObject_Call(%s, %s, %s); %s" % (
self.result(),
call_code,
self.function.py_result(),
self.positional_args.py_result(),
kwargs,
code.error_goto_if_null(self.result(), self.pos)))
code.put_gotref(self.py_result())
......
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