mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
GH-84436: Skip refcounting for known immortals (GH-107605)
This commit is contained in:
parent
ec0a0d2bd9
commit
05a824f294
19 changed files with 52 additions and 65 deletions
|
@ -415,7 +415,7 @@ _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
|
|||
|
||||
/* Convert step to an integer; raise for zero step. */
|
||||
if (self->step == Py_None) {
|
||||
step = Py_NewRef(_PyLong_GetOne());
|
||||
step = _PyLong_GetOne();
|
||||
step_is_negative = 0;
|
||||
}
|
||||
else {
|
||||
|
@ -443,7 +443,7 @@ _PySlice_GetLongIndices(PySliceObject *self, PyObject *length,
|
|||
goto error;
|
||||
}
|
||||
else {
|
||||
lower = Py_NewRef(_PyLong_GetZero());
|
||||
lower = _PyLong_GetZero();
|
||||
upper = Py_NewRef(length);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue