1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 01:58:06 +02:00

Right-size the map array in PartialEvaluator_readToUnicode

We can avoid a lot of intermediate resizings, by directly allocating the required number of elements for the `map` array.
This commit is contained in:
Jonas Jenwald 2015-09-19 16:54:19 +02:00
parent 20b5814249
commit 8d831449ab
3 changed files with 12 additions and 1 deletions

View file

@ -306,6 +306,10 @@ var CMap = (function CMapClosure() {
out.length = 1;
},
get length() {
return this._map.length;
},
get isIdentityCMap() {
if (!(this.name === 'Identity-H' || this.name === 'Identity-V')) {
return false;
@ -382,6 +386,10 @@ var IdentityCMap = (function IdentityCMapClosure() {
readCharCode: CMap.prototype.readCharCode,
get length() {
return 0x10000;
},
get isIdentityCMap() {
error('should not access .isIdentityCMap');
}