From 8783dd017861b3ff13af7f69d5af0da042a6f365 Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 17 Nov 2024 11:57:45 +0100 Subject: [PATCH] Avoid redundant CMap-value lookup in `extendCMap` (PR 5101 follow-up) 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. --- src/core/cmap.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/cmap.js b/src/core/cmap.js index 5e7040c6d2a4e..6c0cab60cc6ae 100644 --- a/src/core/cmap.js +++ b/src/core/cmap.js @@ -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); } });