mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #26200: Added Py_SETREF and replaced Py_XSETREF with Py_SETREF
in places where Py_DECREF was used.
This commit is contained in:
commit
f01e408c16
23 changed files with 58 additions and 48 deletions
|
@ -1830,7 +1830,7 @@ unicode_resize(PyObject **p_unicode, Py_ssize_t length)
|
|||
_Py_INCREF_UNICODE_EMPTY();
|
||||
if (!unicode_empty)
|
||||
return -1;
|
||||
Py_XSETREF(*p_unicode, unicode_empty);
|
||||
Py_SETREF(*p_unicode, unicode_empty);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1838,7 +1838,7 @@ unicode_resize(PyObject **p_unicode, Py_ssize_t length)
|
|||
PyObject *copy = resize_copy(unicode, length);
|
||||
if (copy == NULL)
|
||||
return -1;
|
||||
Py_XSETREF(*p_unicode, copy);
|
||||
Py_SETREF(*p_unicode, copy);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -13547,7 +13547,7 @@ _PyUnicodeWriter_PrepareInternal(_PyUnicodeWriter *writer,
|
|||
return -1;
|
||||
_PyUnicode_FastCopyCharacters(newbuffer, 0,
|
||||
writer->buffer, 0, writer->pos);
|
||||
Py_XSETREF(writer->buffer, newbuffer);
|
||||
Py_SETREF(writer->buffer, newbuffer);
|
||||
}
|
||||
_PyUnicodeWriter_Update(writer);
|
||||
return 0;
|
||||
|
@ -15264,7 +15264,7 @@ PyUnicode_InternInPlace(PyObject **p)
|
|||
|
||||
if (t) {
|
||||
Py_INCREF(t);
|
||||
Py_XSETREF(*p, t);
|
||||
Py_SETREF(*p, t);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue