From 2f4d0e9bb6a1988b59274bd6db980b214fb17d23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lemburg?= Date: Sun, 18 Jun 2000 22:22:27 +0000 Subject: [PATCH] Marc-Andre Lemburg : Added optimization proposed by Andrew Kuchling to the Unicode matching macro. --- Include/unicodeobject.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Include/unicodeobject.h b/Include/unicodeobject.h index bed3b7b8a1a..967334ae2dc 100644 --- a/Include/unicodeobject.h +++ b/Include/unicodeobject.h @@ -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