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:
Serhiy Storchaka 2015-12-27 12:36:18 +02:00
parent a5892abf23
commit 4a1e70fc31
11 changed files with 63 additions and 106 deletions

View file

@ -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;
}