mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Enable the no-lonely-if
ESLint rule
These changes were mostly done automatically, using `gulp lint --fix`, and only a few spots with comments needed manual tweaking; please see https://eslint.org/docs/latest/rules/no-lonely-if
This commit is contained in:
parent
abb24f82fb
commit
c018070e80
15 changed files with 108 additions and 147 deletions
|
@ -207,7 +207,7 @@ class ChunkedStream extends Stream {
|
|||
if (start + length > this.progressiveDataLength) {
|
||||
this.ensureRange(start, start + length);
|
||||
}
|
||||
} else {
|
||||
} else if (start >= this.progressiveDataLength) {
|
||||
// When the `length` is undefined you do *not*, under any circumstances,
|
||||
// want to fallback on calling `this.ensureRange(start, this.end)` since
|
||||
// that would force the *entire* PDF file to be loaded, thus completely
|
||||
|
@ -217,9 +217,7 @@ class ChunkedStream extends Stream {
|
|||
// time/resources during e.g. parsing, since `MissingDataException`s will
|
||||
// require data to be re-parsed, which we attempt to minimize by at least
|
||||
// checking that the *beginning* of the data is available here.
|
||||
if (start >= this.progressiveDataLength) {
|
||||
this.ensureByte(start);
|
||||
}
|
||||
this.ensureByte(start);
|
||||
}
|
||||
|
||||
function ChunkedStreamSubstream() {}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue