From 0906c15c6845140716d9490ecf32e072afc0c655 Mon Sep 17 00:00:00 2001 From: Damien Arrachequesne Date: Sat, 17 Dec 2016 02:38:06 +0100 Subject: [PATCH] Remove useless variable --- index.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/index.js b/index.js index f453c0e..81273ee 100644 --- a/index.js +++ b/index.js @@ -145,7 +145,6 @@ Encoder.prototype.encode = function(obj, callback){ function encodeAsString(obj) { var str = ''; - var nsp = false; // first is type str += obj.type; @@ -159,22 +158,17 @@ function encodeAsString(obj) { // if we have a namespace other than `/` // we append it followed by a comma `,` if (obj.nsp && '/' !== obj.nsp) { - nsp = true; str += obj.nsp; + str += ','; } // immediately followed by the id if (null != obj.id) { - if (nsp) { - str += ','; - nsp = false; - } str += obj.id; } // json data if (null != obj.data) { - if (nsp) str += ','; str += json.stringify(obj.data); }