Simplify the CFFCompiler.compileTypedArray method

Rather than manually creating the Array, we can use the now existing `Array.from` method instead.
This commit is contained in:
Jonas Jenwald 2023-04-15 10:34:57 +02:00
parent 0ce568e789
commit c79bdd6ae6

View File

@ -1845,11 +1845,7 @@ class CFFCompiler {
}
compileTypedArray(data) {
const out = [];
for (let i = 0, ii = data.length; i < ii; ++i) {
out[i] = data[i];
}
return out;
return Array.from(data);
}
compileIndex(index, trackers = []) {