Merge pull request #6476 from Snuffleupagus/PartialEvaluator_readToUnicode-cmap-length

Right-size the `map` array in PartialEvaluator_readToUnicode
This commit is contained in:
Brendan Dahl 2015-10-09 10:31:28 -07:00
commit 3eaeacfe19
3 changed files with 12 additions and 1 deletions

View file

@ -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.