Skip to content

Commit ebd2567

Browse files
committed
combine two substr calls into one in decodePayload to improve performance
1 parent d9d529c commit ebd2567

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/parser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ exports.decodePayload = function (data) {
234234

235235
for (var i = 1, length = ''; i < data.length; i++) {
236236
if (data[i] == '\ufffd') {
237-
ret.push(exports.decodePacket(data.substr(i + 1).substr(0, length)));
237+
ret.push(exports.decodePacket(data.substr(i + 1, length)));
238238
i += Number(length) + 1;
239239
length = '';
240240
} else {

0 commit comments

Comments
 (0)