summaryrefslogtreecommitdiff
path: root/pdf/pdf_page.c
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-01-13 19:31:14 +0000
committerRobin Watts <robin.watts@artifex.com>2012-01-13 20:13:09 +0000
commite5213366409d28029cfa137f2c19d6ab4a828c4a (patch)
tree943a09dbf0c30770a638b0c3634a2ccc53f0c009 /pdf/pdf_page.c
parentb0dd445c76ec8d36648c9f8c9c10b738e963908e (diff)
downloadmupdf-e5213366409d28029cfa137f2c19d6ab4a828c4a.tar.xz
Rework pdf_resolve_indirect to make it idempotent.
pdf_resolve_indirect(x) = pdf_resolve_indirect(pdf_resolve_indirect(x)) now - as long as it doesn't throw an exception. Update the rest of the code to minimise unnecessary function calls. Previously, we were calling one function to find out if an object was a dict, only for that to call a function to see if it needed to resolve the object, then calling another function to actually get the dict, only to have that call the function to check for the dict needing resolving again!
Diffstat (limited to 'pdf/pdf_page.c')
-rw-r--r--pdf/pdf_page.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/pdf/pdf_page.c b/pdf/pdf_page.c
index 7ccf78a3..9869e9d8 100644
--- a/pdf/pdf_page.c
+++ b/pdf/pdf_page.c
@@ -66,10 +66,8 @@ pdf_load_page_tree_node(pdf_xref *xref, fz_obj *node, struct info info)
pdf_load_page_tree_node(xref, obj, info);
}
}
- else if (fz_is_dict(node))
+ else if ((dict = fz_to_dict(node)) != NULL)
{
- dict = fz_resolve_indirect(node);
-
if (info.resources && !fz_dict_gets(dict, "Resources"))
fz_dict_puts(dict, "Resources", info.resources);
if (info.mediabox && !fz_dict_gets(dict, "MediaBox"))