mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-26 10:08:06 +02:00
Enable the no-else-return
ESLint rule
Using `else` after `return` is not necessary, and can often lead to unnecessarily cluttered code. By using the `no-else-return` rule in ESLint we can avoid this pattern, see http://eslint.org/docs/rules/no-else-return.
This commit is contained in:
parent
049d7fa277
commit
4046d67fde
19 changed files with 67 additions and 79 deletions
|
@ -918,15 +918,15 @@ var JpegImage = (function JpegImageClosure() {
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
} else { // `this.numComponents !== 3`
|
||||
if (!this.adobe && this.colorTransform === 1) {
|
||||
// If the Adobe transform marker is not present and the image
|
||||
// dictionary has a 'ColorTransform' entry, explicitly set to `1`,
|
||||
// then the colours should be transformed.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
// `this.numComponents !== 3`
|
||||
if (!this.adobe && this.colorTransform === 1) {
|
||||
// If the Adobe transform marker is not present and the image
|
||||
// dictionary has a 'ColorTransform' entry, explicitly set to `1`,
|
||||
// then the colours should be transformed.
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
|
||||
_convertYccToRgb: function convertYccToRgb(data) {
|
||||
|
@ -1072,9 +1072,8 @@ var JpegImage = (function JpegImageClosure() {
|
|||
if (this._isColorConversionNeeded()) {
|
||||
if (forceRGBoutput) {
|
||||
return this._convertYcckToRgb(data);
|
||||
} else {
|
||||
return this._convertYcckToCmyk(data);
|
||||
}
|
||||
return this._convertYcckToCmyk(data);
|
||||
} else if (forceRGBoutput) {
|
||||
return this._convertCmykToRgb(data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue