1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-25 09:38:06 +02:00

Merge pull request #5071 from nnethercote/font-savings

Optimize a font-heavy document
This commit is contained in:
Yury Delendik 2014-08-05 18:57:46 -05:00
commit 46a9a35ddc
3 changed files with 43 additions and 13 deletions

View file

@ -357,6 +357,14 @@ var BinaryCMapReader = (function BinaryCMapReaderClosure() {
}
function hexToStr(a, size) {
// This code is hot. Special-case some common values to avoid creating an
// object with subarray().
if (size == 1) {
return String.fromCharCode(a[0], a[1]);
}
if (size == 3) {
return String.fromCharCode(a[0], a[1], a[2], a[3]);
}
return String.fromCharCode.apply(null, a.subarray(0, size + 1));
}