diff options
author | Neal Norwitz <nnorwitz@gmail.com> | 2005-12-18 03:16:20 +0000 |
---|---|---|
committer | Neal Norwitz <nnorwitz@gmail.com> | 2005-12-18 03:16:20 +0000 |
commit | 84456bdab35ea8a4c75eeaee6f3320c8c4280007 (patch) | |
tree | 2cb2694b26679e9c7d6fb345970d7a513e13176c /Python/pyarena.c | |
parent | b04747fc50122f3beab804b1ca5af80da52cbd71 (diff) | |
download | cpython-git-84456bdab35ea8a4c75eeaee6f3320c8c4280007.tar.gz |
Cleanup a bit and make things more consistent.
Don't double check for NULLs and don't initialize if not necessary.
No functional changes.
Diffstat (limited to 'Python/pyarena.c')
-rw-r--r-- | Python/pyarena.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/pyarena.c b/Python/pyarena.c index d67753215e..6c99c641ba 100644 --- a/Python/pyarena.c +++ b/Python/pyarena.c @@ -40,9 +40,6 @@ PyArenaList_New(void) static void PyArenaList_FreeObject(PyArenaList *alist) { - if (!alist) - return; - while (alist) { PyArenaList *prev; Py_XDECREF((PyObject *)alist->al_pointer); @@ -56,9 +53,6 @@ PyArenaList_FreeObject(PyArenaList *alist) static void PyArenaList_FreeMalloc(PyArenaList *alist) { - if (!alist) - return; - while (alist) { PyArenaList *prev; if (alist->al_pointer) { @@ -105,7 +99,8 @@ PyArena_Malloc(PyArena *arena, size_t size) void *p; assert(size != 0); p = malloc(size); - PyArena_AddMallocPointer(arena, p); + if (p) + PyArena_AddMallocPointer(arena, p); return p; } |