Commit 7ca531c4 authored by Stefan Behnel's avatar Stefan Behnel

speed up delegation of generators and coroutines a little by avoiding an...

speed up delegation of generators and coroutines a little by avoiding an indirect C call in favour of a directly visible recursive call
parent 553b552b
......@@ -713,6 +713,11 @@ static PyObject *__Pyx_Generator_Next(PyObject *self) {
//Py_INCREF(yf);
// YieldFrom code ensures that yf is an iterator
gen->is_running = 1;
#ifdef __Pyx_Generator_USED
if (__Pyx_Generator_CheckExact(yf)) {
ret = __Pyx_Generator_Next(yf);
} else
#endif
ret = Py_TYPE(yf)->tp_iternext(yf);
gen->is_running = 0;
//Py_DECREF(yf);
......
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