summaryrefslogtreecommitdiff
path: root/source/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-10-22 14:01:57 +0200
committerTor Andersson <tor@ccxvii.net>2014-12-03 01:33:00 +0100
commitfa04ab8e0c40cfc6b248c60e1ec9db028c97988a (patch)
tree00784d862fa844929597cd0a5113ccfb22d742ef /source/fitz
parent5fa0928ecd80b4b5b5eb5880cdb8c7096aa8bf46 (diff)
downloadmupdf-fa04ab8e0c40cfc6b248c60e1ec9db028c97988a.tar.xz
xml: Optimize creation of really long lists by keeping a tail pointer.
Diffstat (limited to 'source/fitz')
-rw-r--r--source/fitz/xml.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/fitz/xml.c b/source/fitz/xml.c
index a9d93eb8..5cdaa673 100644
--- a/source/fitz/xml.c
+++ b/source/fitz/xml.c
@@ -83,7 +83,7 @@ struct fz_xml_s
char name[40];
char *text;
struct attribute *atts;
- fz_xml *up, *down, *prev, *next;
+ fz_xml *up, *down, *tail, *prev, *next;
};
static inline void indent(int n)
@@ -285,13 +285,13 @@ static void xml_emit_open_tag(struct parser *parser, char *a, char *b)
if (!parser->head->down) {
parser->head->down = head;
+ parser->head->tail = head;
}
else {
- tail = parser->head->down;
- while (tail->next)
- tail = tail->next;
+ tail = parser->head->tail;
tail->next = head;
head->prev = tail;
+ parser->head->tail = head;
}
parser->head = head;