fs: removing unnecessary nullCheckCallNT
authorSakthipriyan Vairamani <thechargingvolcano@gmail.com>
Tue, 2 Jun 2015 15:15:21 +0000 (20:45 +0530)
committerTrevor Norris <trev.norris@gmail.com>
Wed, 10 Jun 2015 22:54:26 +0000 (16:54 -0600)
`nullCheckCallNT()` function is not necessary, as we can directly pass
`callback` and `er` to `process.nextTick()`.

PR-URL: https://github.com/nodejs/io.js/pull/1870
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Reviewed-By: Trevor Norris <trev.norris@gmail.com>
lib/fs.js

index ad44e7b..ecef4f2 100644 (file)
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -95,16 +95,12 @@ function nullCheck(path, callback) {
     er.code = 'ENOENT';
     if (typeof callback !== 'function')
       throw er;
-    process.nextTick(nullCheckCallNT, callback, er);
+    process.nextTick(callback, er);
     return false;
   }
   return true;
 }
 
-function nullCheckCallNT(callback, er) {
-  callback(er);
-}
-
 // Static method to set the stats properties on a Stats object.
 fs.Stats = function(
     dev,