mirror of https://github.com/python/cpython
Marc-Andre Lemburg <mal@lemburg.com>:
Added optimization proposed by Andrew Kuchling to the Unicode matching macro.
This commit is contained in:
parent
e8d52af54b
commit
2f4d0e9bb6
|
@ -168,7 +168,8 @@ typedef unsigned short Py_UNICODE;
|
|||
while (0)
|
||||
|
||||
#define Py_UNICODE_MATCH(string, offset, substring)\
|
||||
(!memcmp((string)->str + (offset), (substring)->str,\
|
||||
((*((string)->str + (offset)) == *((substring)->str)) &&\
|
||||
!memcmp((string)->str + (offset), (substring)->str,\
|
||||
(substring)->length*sizeof(Py_UNICODE)))
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
|
Loading…
Reference in New Issue