diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-02 21:12:58 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-02 21:12:58 +0000 |
commit | 5b7139aab41becad7ad736bd9ff2332960bf67f9 (patch) | |
tree | 9d3d3e7da0c0073af1fd2784fa7892d3222f9e88 /Objects/stringlib/unicodedefs.h | |
parent | d3e323215c6d9f303bf42875f98e365e2ff1734f (diff) | |
download | cpython-git-5b7139aab41becad7ad736bd9ff2332960bf67f9.tar.gz |
Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
`rindex`, `rsplit` and `rpartition` methods. Patch by Florent Xicluna.
Diffstat (limited to 'Objects/stringlib/unicodedefs.h')
-rw-r--r-- | Objects/stringlib/unicodedefs.h | 19 |
1 files changed, 0 insertions, 19 deletions
diff --git a/Objects/stringlib/unicodedefs.h b/Objects/stringlib/unicodedefs.h index 8f87fe0f7d..524781ff16 100644 --- a/Objects/stringlib/unicodedefs.h +++ b/Objects/stringlib/unicodedefs.h @@ -31,23 +31,4 @@ #define STRINGLIB_WANT_CONTAINS_OBJ 1 -/* STRINGLIB_CMP was defined as: - -Py_LOCAL_INLINE(int) -STRINGLIB_CMP(const Py_UNICODE* str, const Py_UNICODE* other, Py_ssize_t len) -{ - if (str[0] != other[0]) - return 1; - return memcmp((void*) str, (void*) other, len * sizeof(Py_UNICODE)); -} - -but unfortunately that gives a error if the function isn't used in a file that -includes this file. So, reluctantly convert it to a macro instead. */ - -#define STRINGLIB_CMP(str, other, len) \ - (((str)[0] != (other)[0]) ? \ - 1 : \ - memcmp((void*) (str), (void*) (other), (len) * sizeof(Py_UNICODE))) - - #endif /* !STRINGLIB_UNICODEDEFS_H */ |