Commit a5a2eff5 authored by Stefan Behnel's avatar Stefan Behnel

exclude PyLong optimisation for arithmetic operators in Py2.7 as it's actually...

exclude PyLong optimisation for arithmetic operators in Py2.7 as it's actually unlikely that we'd encounter C long sized PyLong objects in Py2.x (which has the 'int' type for that)
parent 160949a7
......@@ -557,7 +557,7 @@ static PyObject* __Pyx_PyInt_{{op}}{{order}}(PyObject *op1, PyObject *op2, CYTHO
}
#endif
#if CYTHON_USE_PYLONG_INTERNALS
#if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
if (likely(PyLong_CheckExact({{pyval}}))) {
const long {{'a' if order == 'CObj' else 'b'}} = intval;
long x, {{ival}};
......@@ -661,7 +661,7 @@ static PyObject* __Pyx_PyFloat_{{op}}{{order}}(PyObject *op1, PyObject *op2, dou
#endif
if (likely(PyLong_CheckExact({{pyval}}))) {
#if CYTHON_USE_PYLONG_INTERNALS
#if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
const digit* digits = ((PyLongObject*){{pyval}})->ob_digit;
const Py_ssize_t size = Py_SIZE({{pyval}});
switch (size) {
......
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