mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
Merge pull request #4894 from CodingFabian/optimize-jpgjs-receiveAndExtend
Optimize JPG.js receiveAndExtend for 1 bit case.
This commit is contained in:
commit
9308b525e5
1 changed files with 3 additions and 0 deletions
|
@ -159,6 +159,9 @@ var JpegImage = (function jpegImage() {
|
|||
}
|
||||
|
||||
function receiveAndExtend(length) {
|
||||
if (length === 1) {
|
||||
return readBit() === 1 ? 1 : -1;
|
||||
}
|
||||
var n = receive(length);
|
||||
if (n >= 1 << (length - 1)) {
|
||||
return n;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue