Commit 9889fe7b authored by Robert Bradshaw's avatar Robert Bradshaw

Optimize None -> bool to avoid branching

parent bf66352f
...@@ -1398,8 +1398,7 @@ static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) { ...@@ -1398,8 +1398,7 @@ static INLINE Py_ssize_t __pyx_PyIndex_AsSsize_t(PyObject* b) {
static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
if (x == Py_True) return 1; if (x == Py_True) return 1;
else if (x == Py_False) return 0; else if ((x == Py_False) | (x == Py_None)) return 0;
else if (x == Py_None) return 0;
else return PyObject_IsTrue(x); else return PyObject_IsTrue(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