Commit 8ee604b9 authored by Georg Brandl's avatar Georg Brandl

Use Py_CLEAR().

parent 470a1239
......@@ -307,8 +307,7 @@ int unicode_resize(register PyUnicodeObject *unicode,
reset:
/* Reset the object caches */
if (unicode->defenc) {
Py_DECREF(unicode->defenc);
unicode->defenc = NULL;
Py_CLEAR(unicode->defenc);
}
unicode->hash = -1;
......@@ -427,8 +426,7 @@ void unicode_dealloc(register PyUnicodeObject *unicode)
unicode->length = 0;
}
if (unicode->defenc) {
Py_DECREF(unicode->defenc);
unicode->defenc = NULL;
Py_CLEAR(unicode->defenc);
}
/* Add to free list */
*(PyUnicodeObject **)unicode = free_list;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment