diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 2828893474a8f..eae2f8c1f7f25 100644 --- a/src/core/evaluator.js +++ b/src/core/evaluator.js @@ -398,11 +398,9 @@ class PartialEvaluator { // Get the data on the main-thread instead. data = await this.handler.sendWithPromise("FetchBuiltInCMap", { name }); } + // Cache the CMap data, to avoid fetching it repeatedly. + this.builtInCMapCache.set(name, data); - if (data.compressionType !== CMapCompressionType.NONE) { - // Given the size of uncompressed CMaps, only cache compressed ones. - this.builtInCMapCache.set(name, data); - } return data; }