mirror of https://github.com/python/cpython
remove unnecessary clearing of list
This commit is contained in:
parent
c9d504fc29
commit
c71741f413
|
@ -156,7 +156,6 @@ PyArena_New()
|
||||||
void
|
void
|
||||||
PyArena_Free(PyArena *arena)
|
PyArena_Free(PyArena *arena)
|
||||||
{
|
{
|
||||||
int r;
|
|
||||||
assert(arena);
|
assert(arena);
|
||||||
#if defined(Py_DEBUG)
|
#if defined(Py_DEBUG)
|
||||||
/*
|
/*
|
||||||
|
@ -173,12 +172,6 @@ PyArena_Free(PyArena *arena)
|
||||||
assert(arena->a_objects->ob_refcnt == 1);
|
assert(arena->a_objects->ob_refcnt == 1);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Clear all the elements from the list. This is necessary
|
|
||||||
to guarantee that they will be DECREFed. */
|
|
||||||
r = PyList_SetSlice(arena->a_objects,
|
|
||||||
0, PyList_GET_SIZE(arena->a_objects), NULL);
|
|
||||||
assert(r == 0);
|
|
||||||
assert(PyList_GET_SIZE(arena->a_objects) == 0);
|
|
||||||
Py_DECREF(arena->a_objects);
|
Py_DECREF(arena->a_objects);
|
||||||
free(arena);
|
free(arena);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue