mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Replace some Array.prototype
-usage with spread syntax
We have a few, quite old, call-sites that use the `Array.prototype`-format and which can now be replaced with spread syntax instead.
This commit is contained in:
parent
91bdcd8b20
commit
6538409282
3 changed files with 6 additions and 17 deletions
|
@ -1403,7 +1403,7 @@ class PartialEvaluator {
|
|||
} else {
|
||||
const opArgs = operatorList.argsArray[lastIndex];
|
||||
opArgs[0].push(fn);
|
||||
Array.prototype.push.apply(opArgs[1], args);
|
||||
opArgs[1].push(...args);
|
||||
const minMax = opArgs[2];
|
||||
|
||||
// Compute min/max in the worker instead of the main thread.
|
||||
|
@ -1910,17 +1910,11 @@ class PartialEvaluator {
|
|||
self.ensureStateFont(stateManager.state);
|
||||
continue;
|
||||
}
|
||||
var arr = args[0];
|
||||
var combinedGlyphs = [];
|
||||
var arrLength = arr.length;
|
||||
var state = stateManager.state;
|
||||
for (i = 0; i < arrLength; ++i) {
|
||||
const arrItem = arr[i];
|
||||
for (const arrItem of args[0]) {
|
||||
if (typeof arrItem === "string") {
|
||||
Array.prototype.push.apply(
|
||||
combinedGlyphs,
|
||||
self.handleText(arrItem, state)
|
||||
);
|
||||
combinedGlyphs.push(...self.handleText(arrItem, state));
|
||||
} else if (typeof arrItem === "number") {
|
||||
combinedGlyphs.push(arrItem);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue