Skip to content

Commit

Permalink
Unconditionally cache built-in CMaps on the worker-thread
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
Snuffleupagus authored and ryzokuken committed Nov 4, 2024
1 parent b5b9645 commit e8e26fe
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/core/evaluator.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit e8e26fe

Please sign in to comment.