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:
parent
20b5814249
commit
8d831449ab
3 changed files with 12 additions and 1 deletions
|
@ -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');
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue