summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-04-19 17:09:46 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-04-26 15:12:57 +0200
commitc9143d10cfcd9b952c2e4152f64773453f94f0ce (patch)
tree57c1da9b4712359807e7d6e99ea16b9054decac7
parent38d0278ffd22928cfcc66516a5f5a75f2480e702 (diff)
downloadmupdf-c9143d10cfcd9b952c2e4152f64773453f94f0ce.tar.xz
Optimize pdf_lookup_agl.
-rw-r--r--source/pdf/pdf-encoding.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/pdf/pdf-encoding.c b/source/pdf/pdf-encoding.c
index b6bf3e11..d0a4bb88 100644
--- a/source/pdf/pdf-encoding.c
+++ b/source/pdf/pdf-encoding.c
@@ -52,11 +52,11 @@ pdf_lookup_agl(char *name)
return agl_code_list[m];
}
- if (strstr(buf, "uni") == buf)
+ if (buf[0] == 'u' && buf[1] == 'n' && buf[2] == 'i')
code = strtol(buf + 3, NULL, 16);
- else if (strstr(buf, "u") == buf)
+ else if (buf[0] == 'u')
code = strtol(buf + 1, NULL, 16);
- else if (strstr(buf, "a") == buf && strlen(buf) >= 3)
+ else if (buf[0] == 'a' && buf[1] != 0 && buf[2] != 0)
code = strtol(buf + 1, NULL, 10);
return (code >= 0 && code <= 0x10ffff) ? code : 0;