[Python-3000-checkins] r58195 - python/branches/py3k/Objects/dictobject.c

guido.van.rossum python-3000-checkins at python.org
Tue Sep 18 20:39:51 CEST 2007


Author: guido.van.rossum
Date: Tue Sep 18 20:39:50 2007
New Revision: 58195

Modified:
   python/branches/py3k/Objects/dictobject.c
Log:
Thomas Wouters suggested an obvious improvement to unicode_eq():
use memcmp().


Modified: python/branches/py3k/Objects/dictobject.c
==============================================================================
--- python/branches/py3k/Objects/dictobject.c	(original)
+++ python/branches/py3k/Objects/dictobject.c	Tue Sep 18 20:39:50 2007
@@ -340,7 +340,7 @@
 		return 0;
 	if (a->length == 1)
 		return 1;
-	return PyUnicode_Compare(aa, bb) == 0;
+	return memcmp(a->str, b->str, a->length * sizeof(Py_UNICODE)) == 0;
 }
 
 


More information about the Python-3000-checkins mailing list