Browse Source

Faster chunkedStream_getByte()

fkaelberer 11 years ago
parent
commit
9a41659ae7
  1. 11
      src/core/chunked_stream.js

11
src/core/chunked_stream.js

@ -155,8 +155,15 @@ var ChunkedStream = (function ChunkedStreamClosure() {
if (pos >= this.end) { if (pos >= this.end) {
return -1; return -1;
} }
this.ensureByte(pos); var byte = this.bytes[pos];
return this.bytes[this.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() { getUint16: function ChunkedStream_getUint16() {

Loading…
Cancel
Save