Commit ccfeb817 authored by Stefan Behnel's avatar Stefan Behnel

Add branch hints to __Pyx_Coroutine_Close() to optimise for the normal case.

parent 98b60d8f
......@@ -904,7 +904,7 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
if (err == 0)
PyErr_SetNone(PyExc_GeneratorExit);
retval = __Pyx_Coroutine_SendEx(gen, NULL, 1);
if (retval) {
if (unlikely(retval)) {
const char *msg;
Py_DECREF(retval);
if (0) {
......@@ -927,7 +927,7 @@ static PyObject *__Pyx_Coroutine_Close(PyObject *self) {
return NULL;
}
raised_exception = PyErr_Occurred();
if (!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration)) {
if (likely(!raised_exception || __Pyx_PyErr_GivenExceptionMatches2(raised_exception, PyExc_GeneratorExit, PyExc_StopIteration))) {
// ignore these errors
if (raised_exception) PyErr_Clear();
Py_INCREF(Py_None);
......
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