diff options
author | Stefan Behnel <stefan_ml@behnel.de> | 2020-04-20 09:21:18 +0200 |
---|---|---|
committer | Stefan Behnel <stefan_ml@behnel.de> | 2020-04-20 09:21:18 +0200 |
commit | 105491439c2fbc166e73206c49a34196a4e2ff61 (patch) | |
tree | 759948cc2f597b65096f32745b9db8b3370b3eb7 | |
parent | fa0a316e7ecc254ba2a8d20630135639fcdd1ee2 (diff) | |
download | cython-105491439c2fbc166e73206c49a34196a4e2ff61.tar.gz |
Minor code cleanup.
-rw-r--r-- | Cython/Utility/ObjectHandling.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/Cython/Utility/ObjectHandling.c b/Cython/Utility/ObjectHandling.c index 7481a258d..2bc38a3a0 100644 --- a/Cython/Utility/ObjectHandling.c +++ b/Cython/Utility/ObjectHandling.c @@ -318,17 +318,15 @@ static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) { static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) { PyTypeObject *tp = Py_TYPE(obj); - PySequenceMethods *sm; PyMappingMethods *mm = tp->tp_as_mapping; + PySequenceMethods *sm = tp->tp_as_sequence; + if (likely(mm && mm->mp_subscript)) { return mm->mp_subscript(obj, key); } - - sm = tp->tp_as_sequence; if (likely(sm && sm->sq_item)) { return __Pyx_PyObject_GetIndex(obj, key); } - return __Pyx_PyObject_GetItem_Slow(obj, key); } #endif |