mirror of https://github.com/python/cpython
Use Py_CLEAR().
This commit is contained in:
parent
470a123910
commit
8ee604b989
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue