summaryrefslogtreecommitdiffstats
path: root/Python/pyarena.c
diff options
context:
space:
mode:
authorNeal Norwitz <nnorwitz@gmail.com>2005-12-18 03:16:20 (GMT)
committerNeal Norwitz <nnorwitz@gmail.com>2005-12-18 03:16:20 (GMT)
commit84456bdab35ea8a4c75eeaee6f3320c8c4280007 (patch)
tree2cb2694b26679e9c7d6fb345970d7a513e13176c /Python/pyarena.c
parentb04747fc50122f3beab804b1ca5af80da52cbd71 (diff)
downloadcpython-84456bdab35ea8a4c75eeaee6f3320c8c4280007.zip
cpython-84456bdab35ea8a4c75eeaee6f3320c8c4280007.tar.gz
cpython-84456bdab35ea8a4c75eeaee6f3320c8c4280007.tar.bz2
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.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/Python/pyarena.c b/Python/pyarena.c
index d677532..6c99c64 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;
}