mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
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:
commit
3b73ea1278
22 changed files with 125 additions and 80 deletions
|
@ -586,7 +586,7 @@ _PyModule_ClearDict(PyObject *d)
|
|||
while (PyDict_Next(d, &pos, &key, &value)) {
|
||||
if (value != Py_None && PyUnicode_Check(key)) {
|
||||
if (PyUnicode_READ_CHAR(key, 0) != '_' ||
|
||||
PyUnicode_CompareWithASCIIString(key, "__builtins__") != 0)
|
||||
!_PyUnicode_EqualToASCIIString(key, "__builtins__"))
|
||||
{
|
||||
if (Py_VerboseFlag > 1) {
|
||||
const char *s = _PyUnicode_AsString(key);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue