From ebd25676ee562417694e3cc3cd4c1d69f9e7d80e Mon Sep 17 00:00:00 2001 From: Brian Willard Date: Fri, 16 Dec 2011 15:31:48 -0600 Subject: [PATCH] combine two substr calls into one in decodePayload to improve performance --- lib/parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/parser.js b/lib/parser.js index fe0cc379..d56b5500 100644 --- a/lib/parser.js +++ b/lib/parser.js @@ -234,7 +234,7 @@ exports.decodePayload = function (data) { for (var i = 1, length = ''; i < data.length; i++) { if (data[i] == '\ufffd') { - ret.push(exports.decodePacket(data.substr(i + 1).substr(0, length))); + ret.push(exports.decodePacket(data.substr(i + 1, length))); i += Number(length) + 1; length = ''; } else {