mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
gh-99300: Replace Py_INCREF() with Py_NewRef() (#99513)
Replace Py_INCREF() and Py_XINCREF() using a cast with Py_NewRef() and Py_XNewRef().
This commit is contained in:
parent
ea88d34de2
commit
3ed8803ef5
12 changed files with 22 additions and 44 deletions
|
@ -1601,8 +1601,7 @@ set_isub(PySetObject *so, PyObject *other)
|
|||
Py_RETURN_NOTIMPLEMENTED;
|
||||
if (set_difference_update_internal(so, other))
|
||||
return NULL;
|
||||
Py_INCREF(so);
|
||||
return (PyObject *)so;
|
||||
return Py_NewRef(so);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
@ -1639,8 +1638,7 @@ set_symmetric_difference_update(PySetObject *so, PyObject *other)
|
|||
}
|
||||
|
||||
if (PyAnySet_Check(other)) {
|
||||
Py_INCREF(other);
|
||||
otherset = (PySetObject *)other;
|
||||
otherset = (PySetObject *)Py_NewRef(other);
|
||||
} else {
|
||||
otherset = (PySetObject *)make_new_set_basetype(Py_TYPE(so), other);
|
||||
if (otherset == NULL)
|
||||
|
@ -1715,8 +1713,7 @@ set_ixor(PySetObject *so, PyObject *other)
|
|||
if (result == NULL)
|
||||
return NULL;
|
||||
Py_DECREF(result);
|
||||
Py_INCREF(so);
|
||||
return (PyObject *)so;
|
||||
return Py_NewRef(so);
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue