Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

get rid of unnecessary else branches after return

  • Loading branch information...
commit 3bdde19c40233df06238be83bc3bbcf3eb24219f 1 parent 70c013d
cguerreiro-igalia authored May 17, 2012

Showing 1 changed file with 20 additions and 20 deletions. Show diff stats Hide diff stats

  1. 40  rdb-parser.js
40  rdb-parser.js
@@ -202,9 +202,11 @@ function Parser() {
202 202
       var l = Buffer.concat(buffers)[0];
203 203
       if(l === 253) {
204 204
         return cb(null, 'NaN');
205  
-      } else if(l === 254) {
  205
+      }
  206
+      if(l === 254) {
206 207
         return cb(null, '+inf');
207  
-      } else if(l === 255) {
  208
+      }
  209
+      if(l === 255) {
208 210
         return cb(null, '-inf');
209 211
       }
210 212
 
@@ -434,16 +436,15 @@ function Parser() {
434 436
       function getRemaining() {
435 437
         if (remCount === 0) {
436 438
           return cb(null, hash);
437  
-        } else {
438  
-          getString(function(err, s) {
439  
-            if(err) {
440  
-              return cb(err);
441  
-            }
442  
-            hash.push(s);
443  
-            --remCount;
444  
-            getRemaining();
445  
-          });
446 439
         }
  440
+        getString(function(err, s) {
  441
+          if(err) {
  442
+            return cb(err);
  443
+          }
  444
+          hash.push(s);
  445
+          --remCount;
  446
+          getRemaining();
  447
+        });
447 448
       }
448 449
 
449 450
       getRemaining();
@@ -462,16 +463,15 @@ function Parser() {
462 463
       function getRemaining() {
463 464
         if (remCount === 0) {
464 465
           return cb(null, list);
465  
-        } else {
466  
-          getString(function(err, s) {
467  
-            if(err) {
468  
-              return cb(err);
469  
-            }
470  
-            list.push(s);
471  
-            --remCount;
472  
-            getRemaining();
473  
-          });
474 466
         }
  467
+        getString(function(err, s) {
  468
+          if(err) {
  469
+            return cb(err);
  470
+          }
  471
+          list.push(s);
  472
+          --remCount;
  473
+          getRemaining();
  474
+        });
475 475
       }
476 476
 
477 477
       getRemaining();

0 notes on commit 3bdde19

Please sign in to comment.
Something went wrong with that request. Please try again.