Commit b94cd5b2 authored by Stefan Behnel's avatar Stefan Behnel

remove redundant overhead in the __Pyx_(Get|Set|Del)ItemInt_Fast() functions

parent 82eecb28
...@@ -9278,7 +9278,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) ...@@ -9278,7 +9278,7 @@ static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i)
Py_INCREF(r); Py_INCREF(r);
} }
else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) { else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
r = PySequence_GetItem(o, i); r = Py_TYPE(o)->tp_as_sequence->sq_item(o, i);
} }
else { else {
r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); r = __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
...@@ -9315,7 +9315,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje ...@@ -9315,7 +9315,7 @@ static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObje
return 1; return 1;
} }
else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0))) else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && (likely(i >= 0)))
return PySequence_SetItem(o, i, v); return Py_TYPE(o)->tp_as_sequence->sq_ass_item(o, i, v);
else { else {
PyObject *j = PyInt_FromSsize_t(i); PyObject *j = PyInt_FromSsize_t(i);
return __Pyx_SetItemInt_Generic(o, j, v); return __Pyx_SetItemInt_Generic(o, j, v);
...@@ -9343,7 +9343,7 @@ static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) { ...@@ -9343,7 +9343,7 @@ static CYTHON_INLINE int __Pyx_DelItem_Generic(PyObject *o, PyObject *j) {
static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i) { static CYTHON_INLINE int __Pyx_DelItemInt_Fast(PyObject *o, Py_ssize_t i) {
if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && likely(i >= 0)) if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_ass_item && likely(i >= 0))
return PySequence_DelItem(o, i); return Py_TYPE(o)->tp_as_sequence->sq_ass_item(o, i, (PyObject *)NULL);
else { else {
PyObject *j = PyInt_FromSsize_t(i); PyObject *j = PyInt_FromSsize_t(i);
return __Pyx_DelItem_Generic(o, j); return __Pyx_DelItem_Generic(o, j);
......
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