1
0
Fork 0
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:
Jonas Jenwald 2021-04-24 12:36:01 +02:00
parent da0e7ea969
commit da22146b95
14 changed files with 67 additions and 71 deletions

View file

@ -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);
});
}
}
}