mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
Issue #20440: Applied yet one patch for using Py_SETREF.
The patch is automatically generated, it replaces the code that uses Py_CLEAR.
This commit is contained in:
parent
a5892abf23
commit
4a1e70fc31
11 changed files with 63 additions and 106 deletions
|
@ -1001,8 +1001,7 @@ longrangeiter_setstate(longrangeiterobject *r, PyObject *state)
|
|||
return NULL;
|
||||
cmp = PyObject_RichCompareBool(state, zero, Py_LT);
|
||||
if (cmp > 0) {
|
||||
Py_CLEAR(r->index);
|
||||
r->index = zero;
|
||||
Py_SETREF(r->index, zero);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
Py_DECREF(zero);
|
||||
|
@ -1015,9 +1014,8 @@ longrangeiter_setstate(longrangeiterobject *r, PyObject *state)
|
|||
if (cmp > 0)
|
||||
state = r->len;
|
||||
|
||||
Py_CLEAR(r->index);
|
||||
r->index = state;
|
||||
Py_INCREF(r->index);
|
||||
Py_INCREF(state);
|
||||
Py_SETREF(r->index, state);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue