diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-13 07:55:48 +0000 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2010-01-13 07:55:48 +0000 |
commit | 6467213bfd10dd45f0ae6fa607c8052a3bdaec23 (patch) | |
tree | 2d2e16c4f8451c981f75a00bbcc6372561070a18 /Objects/stringlib/stringdefs.h | |
parent | d0ff51c43f7d851f2e3beb230f346c1739152ab0 (diff) | |
download | cpython-git-6467213bfd10dd45f0ae6fa607c8052a3bdaec23.tar.gz |
Issue #7622: Improve the split(), rsplit(), splitlines() and replace()
methods of bytes, bytearray and unicode objects by using a common
implementation based on stringlib's fast search. Patch by Florent Xicluna.
Diffstat (limited to 'Objects/stringlib/stringdefs.h')
-rw-r--r-- | Objects/stringlib/stringdefs.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Objects/stringlib/stringdefs.h b/Objects/stringlib/stringdefs.h index 4a95258e1b..84e461628e 100644 --- a/Objects/stringlib/stringdefs.h +++ b/Objects/stringlib/stringdefs.h @@ -11,6 +11,8 @@ #define STRINGLIB_TYPE_NAME "string" #define STRINGLIB_PARSE_CODE "S" #define STRINGLIB_EMPTY nullstring +#define STRINGLIB_ISSPACE Py_ISSPACE +#define STRINGLIB_ISLINEBREAK(x) ((x == '\n') || (x == '\r')) #define STRINGLIB_ISDECIMAL(x) ((x >= '0') && (x <= '9')) #define STRINGLIB_TODECIMAL(x) (STRINGLIB_ISDECIMAL(x) ? (x - '0') : -1) #define STRINGLIB_TOUPPER Py_TOUPPER @@ -21,8 +23,11 @@ #define STRINGLIB_NEW PyString_FromStringAndSize #define STRINGLIB_RESIZE _PyString_Resize #define STRINGLIB_CHECK PyString_Check +#define STRINGLIB_CHECK_EXACT PyString_CheckExact #define STRINGLIB_TOSTR PyObject_Str #define STRINGLIB_GROUPING _PyString_InsertThousandsGrouping #define STRINGLIB_GROUPING_LOCALE _PyString_InsertThousandsGroupingLocale +#define STRINGLIB_WANT_CONTAINS_OBJ 1 + #endif /* !STRINGLIB_STRINGDEFS_H */ |