mirror of
https://github.com/mozilla/pdf.js.git
synced 2025-04-20 07:08:08 +02:00
Faster chunkedStream_getByte()
This commit is contained in:
parent
2e98f9095e
commit
9a41659ae7
1 changed files with 9 additions and 2 deletions
|
@ -155,8 +155,15 @@ var ChunkedStream = (function ChunkedStreamClosure() {
|
||||||
if (pos >= this.end) {
|
if (pos >= this.end) {
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
var byte = this.bytes[pos];
|
||||||
|
if (byte === 0) {
|
||||||
|
// |byte| might be zero, because the corresponding chunk has not been
|
||||||
|
// loaded yet. In this case, this.ensureByte(pos) will throw an
|
||||||
|
// exception and nothing is returned.
|
||||||
this.ensureByte(pos);
|
this.ensureByte(pos);
|
||||||
return this.bytes[this.pos++];
|
}
|
||||||
|
this.pos++;
|
||||||
|
return byte;
|
||||||
},
|
},
|
||||||
|
|
||||||
getUint16: function ChunkedStream_getUint16() {
|
getUint16: function ChunkedStream_getUint16() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue