Issue #28701: Replace PyUnicode_CompareWithASCIIString with _PyUnicode_EqualToASCIIString.

The latter function is more readable, faster and doesn't raise exceptions.
This commit is contained in:
Serhiy Storchaka 2016-11-16 10:17:58 +02:00
parent 5ebff7b300
commit f4934ea77d
21 changed files with 120 additions and 75 deletions

View file

@ -1638,6 +1638,9 @@ They all return *NULL* or ``-1`` if an exception occurs.
Compare two strings and return ``-1``, ``0``, ``1`` for less than, equal, and greater than,
respectively.
This function returns ``-1`` upon failure, so one should call
:c:func:`PyErr_Occurred` to check for errors.
.. c:function:: int PyUnicode_CompareWithASCIIString(PyObject *uni, const char *string)
@ -1646,6 +1649,9 @@ They all return *NULL* or ``-1`` if an exception occurs.
ASCII-encoded strings, but the function interprets the input string as
ISO-8859-1 if it contains non-ASCII characters.
This function returns ``-1`` upon failure, so one should call
:c:func:`PyErr_Occurred` to check for errors.
.. c:function:: PyObject* PyUnicode_RichCompare(PyObject *left, PyObject *right, int op)