Skip to content

Commit

Permalink
combine two substr calls into one in decodePayload to improve perform…
Browse files Browse the repository at this point in the history
…ance
  • Loading branch information
bwillard committed Dec 16, 2011
1 parent d9d529c commit ebd2567
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/parser.js
Expand Up @@ -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 {
Expand Down

0 comments on commit ebd2567

Please sign in to comment.