mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-25 17:48:07 +02:00
Replace a bunch of Array.prototype.forEach()
cases with for...of
loops instead
Using `for...of` is a modern and generally much nicer pattern, since it gets rid of unnecessary callback-functions. (In a couple of spots, a "regular" `for` loop had to be used.)
This commit is contained in:
parent
da0e7ea969
commit
da22146b95
14 changed files with 67 additions and 71 deletions
|
@ -43,10 +43,9 @@ class PDFWorkerStream {
|
|||
if (this._fullRequestReader) {
|
||||
this._fullRequestReader.cancel(reason);
|
||||
}
|
||||
const readers = this._rangeRequestReaders.slice(0);
|
||||
readers.forEach(function (reader) {
|
||||
for (const reader of this._rangeRequestReaders.slice(0)) {
|
||||
reader.cancel(reason);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue