Merge pull request #13836 from timvandermeij/cmaps

Fix inefficient regular expressions in `external/cmapscompress/parse.js`
This commit is contained in:
Jonas Jenwald 2021-08-01 12:20:51 +02:00 committed by GitHub
commit 1ea8cfa2f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -28,9 +28,9 @@ exports.parseAdobeCMap = function (content) {
usecmap: null,
body: [],
};
m = /\/CMapType\s+(\d+)+\s+def\b/.exec(body);
m = /\/CMapType\s+(\d+)\s+def\b/.exec(body);
result.type = +m[1];
m = /\/WMode\s+(\d+)+\s+def\b/.exec(body);
m = /\/WMode\s+(\d+)\s+def\b/.exec(body);
result.wmode = +m[1];
m = /\/([\w-]+)\s+usecmap\b/.exec(body);
if (m) {