Skip to content

Commit

Permalink
Avoid redundant CMap-value lookup in extendCMap (PR 5101 follow-up)
Browse files Browse the repository at this point in the history
When iterating through `useCMap` the value is already available, without having to manually invoke the `lookup`-method.
While this will likely not affect performance in any noticeable way, it's nonetheless unnecessary to lookup an already available value twice.
  • Loading branch information
Snuffleupagus committed Nov 17, 2024
1 parent 9bf9bbd commit 8783dd0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/cmap.js
Original file line number Diff line number Diff line change
Expand Up @@ -662,7 +662,7 @@ async function extendCMap(cMap, fetchBuiltInCMap, useCMap) {
// any previously defined entries.
cMap.useCMap.forEach(function (key, value) {
if (!cMap.contains(key)) {
cMap.mapOne(key, cMap.useCMap.lookup(key));
cMap.mapOne(key, value);
}
});

Expand Down

0 comments on commit 8783dd0

Please sign in to comment.