mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-23 16:48:08 +02:00
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).
This commit is contained in:
parent
bde36f28be
commit
50c291eb33
1 changed files with 2 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue