Fixed issue #1564: The set implementation should special-case PyUnicode instead of PyString

I moved the unicode_eq to stringlib/eq.h to keep the function static and possible inline for setobject.c and dictobject.h. I also removed the unused _PyString_Eq method. If it's required in the future it can be added to eq.h
This commit is contained in:
Christian Heimes 2007-12-10 15:50:56 +00:00
parent 110194048e
commit 0ded5b54bb
7 changed files with 85 additions and 45 deletions

View file

@ -877,16 +877,6 @@ string_richcompare(PyStringObject *a, PyStringObject *b, int op)
return result;
}
int
_PyString_Eq(PyObject *o1, PyObject *o2)
{
PyStringObject *a = (PyStringObject*) o1;
PyStringObject *b = (PyStringObject*) o2;
return Py_Size(a) == Py_Size(b)
&& *a->ob_sval == *b->ob_sval
&& memcmp(a->ob_sval, b->ob_sval, Py_Size(a)) == 0;
}
static long
string_hash(PyStringObject *a)
{