Faster chunkedStream_getByte()
This commit is contained in:
parent
2e98f9095e
commit
9a41659ae7
@ -155,8 +155,15 @@ var ChunkedStream = (function ChunkedStreamClosure() {
|
||||
if (pos >= this.end) {
|
||||
return -1;
|
||||
}
|
||||
this.ensureByte(pos);
|
||||
return this.bytes[this.pos++];
|
||||
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.pos++;
|
||||
return byte;
|
||||
},
|
||||
|
||||
getUint16: function ChunkedStream_getUint16() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user