Commit 71c84cd2 authored by Stefan Behnel's avatar Stefan Behnel

fix previously untested __Pyx_UnicodeContainsUCS4() implementation for PEP 393

parent 4ac02a69
......@@ -7016,9 +7016,10 @@ static CYTHON_INLINE int __Pyx_UnicodeContainsUCS4(PyObject* unicode, Py_UCS4 ch
#ifdef CYTHON_PEP393_ENABLED
Py_ssize_t i;
const int kind = PyUnicode_KIND(unicode);
const void* udata = PyUnicode_DATA(unicode);
const Py_ssize_t length = PyUnicode_GET_LENGTH(unicode);
for (i=0; i < length; i++) {
if (unlikely(uchar == PyUnicode_READ(kind, unicode, i))) return 1;
if (unlikely(character == PyUnicode_READ(kind, udata, i))) return 1;
}
return 0;
#else
......
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