Commit fd5186d4 authored by Stefan Behnel's avatar Stefan Behnel

move some utility code to the back of the file

parent 9962ade0
......@@ -531,6 +531,12 @@ static CYTHON_INLINE int __Pyx_Py_UNICODE_ISTITLE(Py_UCS4 uchar)
/////////////// unicode_tailmatch.proto ///////////////
static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction); /*proto*/
/////////////// unicode_tailmatch ///////////////
// Python's unicode.startswith() and unicode.endswith() support a
// tuple of prefixes/suffixes, whereas it's much more common to
// test for a single unicode string.
......@@ -562,6 +568,13 @@ static int __Pyx_PyUnicode_Tailmatch(PyObject* s, PyObject* substr,
/////////////// bytes_tailmatch.proto ///////////////
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
Py_ssize_t start, Py_ssize_t end, int direction); /*proto*/
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction); /*proto*/
/////////////// bytes_tailmatch ///////////////
static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
Py_ssize_t start, Py_ssize_t end, int direction) {
const char* self_ptr = PyBytes_AS_STRING(self);
......@@ -619,8 +632,7 @@ static int __Pyx_PyBytes_SingleTailmatch(PyObject* self, PyObject* arg,
}
static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
Py_ssize_t start, Py_ssize_t end, int direction)
{
Py_ssize_t start, Py_ssize_t end, int direction) {
if (unlikely(PyTuple_Check(substr))) {
Py_ssize_t i, count = PyTuple_GET_SIZE(substr);
for (i = 0; i < count; i++) {
......@@ -648,7 +660,7 @@ static int __Pyx_PyBytes_Tailmatch(PyObject* self, PyObject* substr,
/////////////// str_tailmatch.proto ///////////////
static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py_ssize_t start,
Py_ssize_t end, int direction);
Py_ssize_t end, int direction); /*proto*/
/////////////// str_tailmatch ///////////////
//@requires: bytes_tailmatch
......@@ -670,6 +682,10 @@ static CYTHON_INLINE int __Pyx_PyStr_Tailmatch(PyObject* self, PyObject* arg, Py
/////////////// bytes_index.proto ///////////////
static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds); /*proto*/
/////////////// bytes_index ///////////////
static CYTHON_INLINE char __Pyx_PyBytes_GetItemInt(PyObject* bytes, Py_ssize_t index, int check_bounds) {
if (check_bounds) {
Py_ssize_t size = PyBytes_GET_SIZE(bytes);
......
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