1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-26 10:08:06 +02:00

Enable the unicorn/prefer-ternary ESLint plugin rule

To limit the readability impact of these changes, the `only-single-line` option was used; please find additional details at https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prefer-ternary.md

These changes were done automatically, using the `gulp lint --fix` command.
This commit is contained in:
Jonas Jenwald 2023-07-27 09:18:26 +02:00
parent 8f83a1359e
commit 674e7ee381
31 changed files with 123 additions and 265 deletions

View file

@ -786,11 +786,10 @@ class CCITTFaxDecoder {
}
}
if (codingLine[0] > 0) {
this.outputBits = codingLine[(this.codingPos = 0)];
} else {
this.outputBits = codingLine[(this.codingPos = 1)];
}
this.outputBits =
codingLine[0] > 0
? codingLine[(this.codingPos = 0)]
: codingLine[(this.codingPos = 1)];
this.row++;
}
@ -964,11 +963,7 @@ class CCITTFaxDecoder {
return 1;
}
if (code >> 5 === 0) {
p = whiteTable1[code];
} else {
p = whiteTable2[code >> 3];
}
p = code >> 5 === 0 ? whiteTable1[code] : whiteTable2[code >> 3];
if (p[0] > 0) {
this._eatBits(p[0]);