From e74a65fd0a98d15fec3687b0c33871bf2e7f79fd Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Fri, 26 Jun 2015 19:21:15 -0400 Subject: [PATCH] Combined slice calls for performance improvement. --- lib/encoding/bufferreader.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/encoding/bufferreader.js b/lib/encoding/bufferreader.js index 34f8580bf..a730a61dd 100644 --- a/lib/encoding/bufferreader.js +++ b/lib/encoding/bufferreader.js @@ -91,9 +91,8 @@ BufferReader.prototype.readUInt64BEBN = function() { }; BufferReader.prototype.readUInt64LEBN = function() { - var buf = this.buf.slice(this.pos, this.pos + 8); - var array = Array.prototype.slice.call(buf, 0); - var bn = new BN(array, 10, 'le'); + var data = Array.prototype.slice.call(this.buf, this.pos, this.pos + 8); + var bn = new BN(data, 10, 'le'); this.pos = this.pos + 8; return bn; };