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

Reduce unnecessary duplication of the isDefaultDecode methods on ColorSpace instances

The recent PR 10482 made me realize that I missed an opportunity for simplification when doing the class conversion of this code in PR 10007.
This commit is contained in:
Jonas Jenwald 2019-01-25 08:19:26 +01:00
parent e2701d5422
commit 29f36d7a1b
2 changed files with 18 additions and 31 deletions

View file

@ -171,7 +171,8 @@ var PDFImage = (function PDFImageClosure() {
if (this.decode &&
((this.colorSpace &&
!this.colorSpace.isDefaultDecode(this.decode, bitsPerComponent)) ||
(isMask && !ColorSpace.isDefaultDecode(this.decode, 1)))) {
(isMask &&
!ColorSpace.isDefaultDecode(this.decode, /* numComps = */ 1)))) {
this.needsDecode = true;
// Do some preprocessing to avoid more math.
var max = (1 << bitsPerComponent) - 1;