mirror of
https://github.com/python/cpython.git
synced 2025-09-09 02:11:51 +00:00
gh-99300: Use Py_NewRef() in Objects/ directory (#99354)
Replace Py_INCREF() and Py_XINCREF() with Py_NewRef() and Py_XNewRef() in C files of the Objects/ directory.
This commit is contained in:
parent
1960eb005e
commit
3a1dde8f29
13 changed files with 66 additions and 128 deletions
|
@ -17,8 +17,7 @@ return_self(PyObject *self)
|
|||
{
|
||||
#if !STRINGLIB_MUTABLE
|
||||
if (STRINGLIB_CHECK_EXACT(self)) {
|
||||
Py_INCREF(self);
|
||||
return self;
|
||||
return Py_NewRef(self);
|
||||
}
|
||||
#endif
|
||||
return STRINGLIB_NEW(STRINGLIB_STR(self), STRINGLIB_LEN(self));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue