Combined slice calls for performance improvement.
This commit is contained in:
parent
8e6b0147b9
commit
e74a65fd0a
|
@ -91,9 +91,8 @@ BufferReader.prototype.readUInt64BEBN = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
BufferReader.prototype.readUInt64LEBN = function() {
|
BufferReader.prototype.readUInt64LEBN = function() {
|
||||||
var buf = this.buf.slice(this.pos, this.pos + 8);
|
var data = Array.prototype.slice.call(this.buf, this.pos, this.pos + 8);
|
||||||
var array = Array.prototype.slice.call(buf, 0);
|
var bn = new BN(data, 10, 'le');
|
||||||
var bn = new BN(array, 10, 'le');
|
|
||||||
this.pos = this.pos + 8;
|
this.pos = this.pos + 8;
|
||||||
return bn;
|
return bn;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue