smarter
This commit is contained in:
parent
6cee393c5d
commit
8e049b7244
|
@ -27,13 +27,10 @@ BufferReader.prototype.buffer = function(len) {
|
||||||
};
|
};
|
||||||
|
|
||||||
BufferReader.prototype.read = function(len) {
|
BufferReader.prototype.read = function(len) {
|
||||||
if (len) {
|
if (!len)
|
||||||
var buf = this.buf.slice(this.pos, this.pos + len);
|
var len = this.buf.length;
|
||||||
this.pos = this.pos + len;
|
var buf = this.buf.slice(this.pos, this.pos + len);
|
||||||
return buf;
|
this.pos = this.pos + len;
|
||||||
}
|
|
||||||
var buf = this.buf.slice(this.pos);
|
|
||||||
this.pos = this.buf.length;
|
|
||||||
return buf;
|
return buf;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue