mirror of
https://github.com/python/cpython.git
synced 2025-08-01 07:33:08 +00:00
needforspeed: stringlib refactoring, continued. added count and
find helpers; updated unicodeobject to use stringlib_count
This commit is contained in:
parent
a26de2a80f
commit
58b5e84d52
5 changed files with 136 additions and 57 deletions
|
@ -3,9 +3,15 @@
|
|||
#ifndef STRINGLIB_PARTITION_H
|
||||
#define STRINGLIB_PARTITION_H
|
||||
|
||||
#ifndef STRINGLIB_FASTSEARCH_H
|
||||
#error must include "stringlib/fastsearch.h" before including this module
|
||||
#endif
|
||||
|
||||
Py_LOCAL(PyObject*)
|
||||
partition(PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
|
||||
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len)
|
||||
stringlib_partition(
|
||||
PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
|
||||
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len
|
||||
)
|
||||
{
|
||||
PyObject* out;
|
||||
Py_ssize_t pos;
|
||||
|
@ -46,8 +52,10 @@ partition(PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
|
|||
}
|
||||
|
||||
Py_LOCAL(PyObject*)
|
||||
rpartition(PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
|
||||
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len)
|
||||
stringlib_rpartition(
|
||||
PyObject* str_obj, const STRINGLIB_CHAR* str, Py_ssize_t str_len,
|
||||
PyObject* sep_obj, const STRINGLIB_CHAR* sep, Py_ssize_t sep_len
|
||||
)
|
||||
{
|
||||
PyObject* out;
|
||||
Py_ssize_t pos;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue