Replace getAll with getKeys in loadType3Data

Not only is `getAll` less efficient, but given that we actually need the keys here, using `getKeys` seems much more suitable.
This commit is contained in:
Jonas Jenwald 2016-02-10 20:19:14 +01:00
parent 33b57d7450
commit f7f60197ce

View File

@ -2100,13 +2100,13 @@ var TranslatedFont = (function TranslatedFontClosure() {
var translatedFont = this.font;
var loadCharProcsPromise = Promise.resolve();
var charProcs = this.dict.get('CharProcs').getAll();
var charProcs = this.dict.get('CharProcs');
var fontResources = this.dict.get('Resources') || resources;
var charProcKeys = Object.keys(charProcs);
var charProcKeys = charProcs.getKeys();
var charProcOperatorList = Object.create(null);
for (var i = 0, n = charProcKeys.length; i < n; ++i) {
loadCharProcsPromise = loadCharProcsPromise.then(function (key) {
var glyphStream = charProcs[key];
var glyphStream = charProcs.get(key);
var operatorList = new OperatorList();
return evaluator.getOperatorList(glyphStream, task, fontResources,
operatorList).then(function () {