From 027671e6dc2580008fd91796b14ef06bf3b54d8f Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Sun, 3 May 2026 16:32:48 +0200 Subject: [PATCH] Replace a loop with `TypedArray.prototype.set()` in the `compileFDSelect` method Given that the `fdSelect.fdSelect` data is a regular Array, this code can simplified a tiny bit. --- src/core/cff_parser.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/core/cff_parser.js b/src/core/cff_parser.js index f13bc7706..09fe85f10 100644 --- a/src/core/cff_parser.js +++ b/src/core/cff_parser.js @@ -1845,9 +1845,7 @@ class CFFCompiler { case 0: out = new Uint8Array(1 + fdSelect.fdSelect.length); out[0] = format; - for (i = 0; i < fdSelect.fdSelect.length; i++) { - out[i + 1] = fdSelect.fdSelect[i]; - } + out.set(fdSelect.fdSelect, 1); break; case 3: const start = 0;