mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-10 02:05:37 +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
|
@ -1380,7 +1380,7 @@ var PartialEvaluator = (function PartialEvaluatorClosure() {
|
|||
if (cmap instanceof IdentityCMap) {
|
||||
return new IdentityToUnicodeMap(0, 0xFFFF);
|
||||
}
|
||||
var map = [];
|
||||
var map = new Array(cmap.length);
|
||||
// Convert UTF-16BE
|
||||
// NOTE: cmap can be a sparse array, so use forEach instead of for(;;)
|
||||
// to iterate over all keys.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue