switch optimization
This commit is contained in:
parent
180747dbdc
commit
03c5fa3d19
14
pdf.js
14
pdf.js
@ -2081,17 +2081,9 @@ var LZWStream = (function() {
|
|||||||
dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;
|
dictionaryLengths[nextCode] = dictionaryLengths[prevCode] + 1;
|
||||||
dictionaryValues[nextCode] = currentSequence[0];
|
dictionaryValues[nextCode] = currentSequence[0];
|
||||||
nextCode++;
|
nextCode++;
|
||||||
switch (nextCode + earlyChange) {
|
codeLength = (nextCode + earlyChange) & (nextCode + earlyChange - 1) ?
|
||||||
case 512:
|
codeLength : Math.min(Math.log(nextCode + earlyChange) /
|
||||||
codeLength = 10;
|
0.6931471805599453 + 1, 12) | 0;
|
||||||
break;
|
|
||||||
case 1024:
|
|
||||||
codeLength = 11;
|
|
||||||
break;
|
|
||||||
case 2048:
|
|
||||||
codeLength = 12;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
prevCode = code;
|
prevCode = code;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user