Commit 6a6517cb authored by Stefan Behnel's avatar Stefan Behnel

add integer fast-path to __Pyx_PyIndex_AsSsize_t()

parent f3c5faea
......@@ -278,6 +278,8 @@ static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
Py_ssize_t ival;
if (likely(PyInt_CheckExact(b)))
return PyInt_AsSsize_t(b);
PyObject* x = PyNumber_Index(b);
if (!x) return -1;
ival = PyInt_AsSsize_t(x);
......
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