Commit 449e3b58 authored by Stefan Behnel's avatar Stefan Behnel

disable some CPython tuned string optimisations in PyPy

--HG--
extra : transplant_source : %5D%18L%A0%A91/%B1%96Z%9ECr%07%AD%C7wp%7B%CA
parent 87e3baf2
...@@ -90,6 +90,9 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int ...@@ -90,6 +90,9 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
//////////////////// UnicodeEquals //////////////////// //////////////////// UnicodeEquals ////////////////////
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
if (s1 == s2) { if (s1 == s2) {
/* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */ /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */
return (equals == Py_EQ); return (equals == Py_EQ);
...@@ -133,6 +136,7 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int ...@@ -133,6 +136,7 @@ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int
Py_DECREF(py_result); Py_DECREF(py_result);
return result; return result;
} }
#endif
} }
...@@ -144,6 +148,9 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq ...@@ -144,6 +148,9 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
//@requires: IncludeStringH //@requires: IncludeStringH
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY
return PyObject_RichCompareBool(s1, s2, equals);
#else
if (s1 == s2) { if (s1 == s2) {
/* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */ /* as done by PyObject_RichCompareBool(); also catches the (interned) empty string */
return (equals == Py_EQ); return (equals == Py_EQ);
...@@ -172,4 +179,5 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq ...@@ -172,4 +179,5 @@ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int eq
Py_DECREF(py_result); Py_DECREF(py_result);
return result; return result;
} }
#endif
} }
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