summaryrefslogtreecommitdiff
path: root/pdf/pdf_object.c
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2012-08-04 19:34:09 +0200
committerSebastian Rasmussen <sebras@gmail.com>2012-08-06 13:59:20 +0200
commit0df1f84bd59e94798a09b55aac1d7cba40be60d0 (patch)
tree2c402ccc3f9c376bfb4a37ffa8b20e7e4cfa2c50 /pdf/pdf_object.c
parent4c00e74b4124474a736678e5554f9d8057c78de8 (diff)
downloadmupdf-0df1f84bd59e94798a09b55aac1d7cba40be60d0.tar.xz
No need to check for NULL before dropping objects
Diffstat (limited to 'pdf/pdf_object.c')
-rw-r--r--pdf/pdf_object.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/pdf/pdf_object.c b/pdf/pdf_object.c
index 7021fa5d..955cd5cf 100644
--- a/pdf/pdf_object.c
+++ b/pdf/pdf_object.c
@@ -512,8 +512,7 @@ pdf_array_put(pdf_obj *obj, int i, pdf_obj *item)
fz_warn(obj->ctx, "assert: index %d > length %d", i, obj->u.a.len);
else
{
- if (obj->u.a.items[i])
- pdf_drop_obj(obj->u.a.items[i]);
+ pdf_drop_obj(obj->u.a.items[i]);
obj->u.a.items[i] = pdf_keep_obj(item);
}
}
@@ -1090,8 +1089,7 @@ pdf_free_array(pdf_obj *obj)
int i;
for (i = 0; i < obj->u.a.len; i++)
- if (obj->u.a.items[i])
- pdf_drop_obj(obj->u.a.items[i]);
+ pdf_drop_obj(obj->u.a.items[i]);
fz_free(obj->ctx, obj->u.a.items);
fz_free(obj->ctx, obj);
@@ -1103,10 +1101,8 @@ pdf_free_dict(pdf_obj *obj)
int i;
for (i = 0; i < obj->u.d.len; i++) {
- if (obj->u.d.items[i].k)
- pdf_drop_obj(obj->u.d.items[i].k);
- if (obj->u.d.items[i].v)
- pdf_drop_obj(obj->u.d.items[i].v);
+ pdf_drop_obj(obj->u.d.items[i].k);
+ pdf_drop_obj(obj->u.d.items[i].v);
}
fz_free(obj->ctx, obj->u.d.items);