Skip to content

Commit 50c291e

Browse files
committed
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).
1 parent bde36f2 commit 50c291e

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/core/evaluator.js

+2-4
Original file line numberDiff line numberDiff line change
@@ -398,11 +398,9 @@ class PartialEvaluator {
398398
// Get the data on the main-thread instead.
399399
data = await this.handler.sendWithPromise("FetchBuiltInCMap", { name });
400400
}
401+
// Cache the CMap data, to avoid fetching it repeatedly.
402+
this.builtInCMapCache.set(name, data);
401403

402-
if (data.compressionType !== CMapCompressionType.NONE) {
403-
// Given the size of uncompressed CMaps, only cache compressed ones.
404-
this.builtInCMapCache.set(name, data);
405-
}
406404
return data;
407405
}
408406

0 commit comments

Comments
 (0)