Staging
v0.5.1
https://github.com/python/cpython
Revision df8709d7b141c334ebacbf0e4380de7fd90d1276 authored by Brett Cannon on 01 April 2009, 20:01:47 UTC, committed by Brett Cannon on 01 April 2009, 20:01:47 UTC
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70975 | brett.cannon | 2009-04-01 12:57:10 -0700 (Wed, 01 Apr 2009) | 4 lines

  test_logging was blindly clearing the warnings filter. This caused
  PendingDeprecationWarnings to be spewed all over by unittest.failIf*(). Fix
  moves over to using warnings.catch_warning to protect the warnings filter.
........
1 parent 3f10a95
Raw File
Tip revision: df8709d7b141c334ebacbf0e4380de7fd90d1276 authored by Brett Cannon on 01 April 2009, 20:01:47 UTC
Merged revisions 70975 via svnmerge from
Tip revision: df8709d
eq.h
/* Fast unicode equal function optimized for dictobject.c and setobject.c */

/* Return 1 if two unicode objects are equal, 0 if not.
 * unicode_eq() is called when the hash of two unicode objects is equal.
 */
Py_LOCAL_INLINE(int)
unicode_eq(PyObject *aa, PyObject *bb)
{
	register PyUnicodeObject *a = (PyUnicodeObject *)aa;
	register PyUnicodeObject *b = (PyUnicodeObject *)bb;

	if (a->length != b->length)
		return 0;
	if (a->length == 0)
		return 1;
	if (a->str[0] != b->str[0])
		return 0;
	if (a->length == 1)
		return 1;
	return memcmp(a->str, b->str, a->length * sizeof(Py_UNICODE)) == 0;
}
back to top