Remove the instanceof AlternateCS
check in ColorSpace.parse
since it's dead code
Looking at `ColorSpace.parseToIR`, it will do one of the following things when called: 1. Return a String. 2. Return an Array. 3. Throw a `FormatError`. 4. In one case, return the result of *another* `ColorSpace.parseToIR` call. However, under no circumstances will it ever return an `AlternateCS` instance. Since it's often useful to understand why code, which has become unused, existed in the first place, let's grab a hard hat and a shovel and start digging through the history of this code :-) The current condition was introduced in commitc198ec4323
, in PR 794, but it was actually already obsolete by that time. The preceeding `instanceof SeparationCS` condition predates commita7278b7fbc
, in PR 700. That condition was originally introduced all the way back in commit4e3f87b60c
, in PR 692. However, it was made obsolete by commit9dcefe1efc
, which is included in the very same PR! Hence we're left with the conclusion that not only has this code be unused for *almost* six years, it was basically never used at all save for a few refactoring commits that're part of PR 692.
This commit is contained in:
parent
d7b37ae745
commit
8a084aff0f
@ -201,10 +201,7 @@ var ColorSpace = (function ColorSpaceClosure() {
|
|||||||
};
|
};
|
||||||
|
|
||||||
ColorSpace.parse = function ColorSpace_parse(cs, xref, res) {
|
ColorSpace.parse = function ColorSpace_parse(cs, xref, res) {
|
||||||
var IR = ColorSpace.parseToIR(cs, xref, res);
|
let IR = ColorSpace.parseToIR(cs, xref, res);
|
||||||
if (IR instanceof AlternateCS) {
|
|
||||||
return IR;
|
|
||||||
}
|
|
||||||
return ColorSpace.fromIR(IR);
|
return ColorSpace.fromIR(IR);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user