refactor(size) onReaddir

This commit is contained in:
coderaiser 2014-11-19 08:09:48 -05:00
parent f9ef655429
commit bbdf35a17f

View file

@ -94,11 +94,13 @@
++asyncRunning;
fs.readdir(dir, function(error, files) {
if (error && stopOnError) {
asyncRunning--;
if (!error) {
onReaddir(dir, files);
} else if (error && stopOnError) {
wasError = true;
emitter.emit('error', error);
} else {
onReaddir(dir, files);
}
});
}
@ -109,9 +111,7 @@
}
function onReaddir(dir, files) {
var n = files.length;
asyncRunning--;
var n = files.length;
fileCounter += n;