diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-10-20 14:06:41 +0200 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-10-21 12:17:40 +0200 |
commit | 057d22283c013127e71fca88a46bd05886945576 (patch) | |
tree | e7108c1dbe7423ec534a24e14c9a2565537df892 /source/html | |
parent | 92900198b45475e78a9b108dc4e6b2a8e5852a52 (diff) | |
download | mupdf-057d22283c013127e71fca88a46bd05886945576.tar.xz |
epub: Don't call strcmp for quick tag name checks.
Diffstat (limited to 'source/html')
-rw-r--r-- | source/html/html-layout.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/html/html-layout.c b/source/html/html-layout.c index 323b0532..d3a0c90f 100644 --- a/source/html/html-layout.c +++ b/source/html/html-layout.c @@ -621,7 +621,7 @@ static void generate_boxes(fz_context *ctx, fz_xml *node, fz_html_box *top, display = fz_get_css_match_display(&match); - if (!strcmp(tag, "br")) + if (tag[0]=='b' && tag[1]=='r' && tag[2]==0) { if (top->type == BOX_INLINE) { @@ -639,7 +639,7 @@ static void generate_boxes(fz_context *ctx, fz_xml *node, fz_html_box *top, g->at_bol = 1; } - else if (!strcmp(tag, "img")) + else if (tag[0]=='i' && tag[1]=='m' && tag[2]=='g' && tag[3]==0) { const char *src = fz_xml_att(node, "src"); if (src) @@ -651,7 +651,7 @@ static void generate_boxes(fz_context *ctx, fz_xml *node, fz_html_box *top, } } - else if (g->is_fb2 && !strcmp(tag, "image")) + else if (g->is_fb2 && tag[0]=='i' && tag[1]=='m' && tag[2]=='a' && tag[3]=='g' && tag[4]=='e' && tag[5]==0) { const char *src = fz_xml_att(node, "l:href"); if (src && src[0] == '#') @@ -716,7 +716,7 @@ static void generate_boxes(fz_context *ctx, fz_xml *node, fz_html_box *top, else if (display == DIS_INLINE) { insert_inline_box(ctx, box, top, child_dir, g); - if (!strcmp(tag, "a")) + if (tag[0]=='a' && tag[1]==0) { id = fz_xml_att(node, "id"); if (id) |