Skip to content

Commit c2d0a08

Browse files
authoredDec 17, 2016
[refactor] Remove useless variable (#55)
1 parent aed8257 commit c2d0a08

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed
 

‎index.js

+1-7
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ Encoder.prototype.encode = function(obj, callback){
145145

146146
function encodeAsString(obj) {
147147
var str = '';
148-
var nsp = false;
149148

150149
// first is type
151150
str += obj.type;
@@ -159,22 +158,17 @@ function encodeAsString(obj) {
159158
// if we have a namespace other than `/`
160159
// we append it followed by a comma `,`
161160
if (obj.nsp && '/' !== obj.nsp) {
162-
nsp = true;
163161
str += obj.nsp;
162+
str += ',';
164163
}
165164

166165
// immediately followed by the id
167166
if (null != obj.id) {
168-
if (nsp) {
169-
str += ',';
170-
nsp = false;
171-
}
172167
str += obj.id;
173168
}
174169

175170
// json data
176171
if (null != obj.data) {
177-
if (nsp) str += ',';
178172
str += json.stringify(obj.data);
179173
}
180174

0 commit comments

Comments
 (0)
Please sign in to comment.