Issue #20440: Cleaning up the code by using Py_SETREF.

This commit is contained in:
Serhiy Storchaka 2016-01-05 21:27:54 +02:00
parent dcf76c9d0a
commit 576f132b98
14 changed files with 39 additions and 120 deletions

View file

@ -396,10 +396,8 @@ element_init(PyObject *self, PyObject *args, PyObject *kwds)
Py_XDECREF(attrib);
/* Replace the objects already pointed to by tag, text and tail. */
tmp = self_elem->tag;
Py_INCREF(tag);
self_elem->tag = tag;
Py_DECREF(tmp);
Py_SETREF(self_elem->tag, tag);
tmp = self_elem->text;
Py_INCREF(Py_None);