From 50c291eb33d8553b63c130779a4edfeac98d85e8 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 23 Oct 2024 12:03:12 +0200 Subject: [PATCH] Unconditionally cache built-in CMaps on the worker-thread Given that we've not shipped, nor used, anything except binary CMaps for years let's just cache them unconditionally (since that's a tiny bit less code). --- src/core/evaluator.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/evaluator.js b/src/core/evaluator.js index 282889347..eae2f8c1f 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; }