mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 17:30:09 +02:00
Use more for...of
loops in the code-base
Most, if not all, of this code is old enough to predate the general availability of `for...of` iteration.
This commit is contained in:
parent
4e58dabb32
commit
60f6272ed9
16 changed files with 70 additions and 101 deletions
|
@ -187,9 +187,9 @@ class PDFFunction {
|
|||
}
|
||||
|
||||
const fnArray = [];
|
||||
for (let j = 0, jj = fnObj.length; j < jj; j++) {
|
||||
for (const fn of fnObj) {
|
||||
fnArray.push(
|
||||
this.parse({ xref, isEvalSupported, fn: xref.fetchIfRef(fnObj[j]) })
|
||||
this.parse({ xref, isEvalSupported, fn: xref.fetchIfRef(fn) })
|
||||
);
|
||||
}
|
||||
return function (src, srcOffset, dest, destOffset) {
|
||||
|
@ -364,12 +364,9 @@ class PDFFunction {
|
|||
throw new FormatError("Bad domain for stiched function");
|
||||
}
|
||||
|
||||
const fnRefs = dict.get("Functions");
|
||||
const fns = [];
|
||||
for (let i = 0, ii = fnRefs.length; i < ii; ++i) {
|
||||
fns.push(
|
||||
this.parse({ xref, isEvalSupported, fn: xref.fetchIfRef(fnRefs[i]) })
|
||||
);
|
||||
for (const fn of dict.get("Functions")) {
|
||||
fns.push(this.parse({ xref, isEvalSupported, fn: xref.fetchIfRef(fn) }));
|
||||
}
|
||||
|
||||
const bounds = toNumberArray(dict.getArray("Bounds"));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue