remove unnecessary call to async.series in OutputFileFinder

callback was previously async but is now synchronous, so high stack
usage.
This commit is contained in:
Brian Gough 2015-03-16 16:47:14 +00:00
parent 416d7a17a7
commit 59c25fc703

View file

@ -17,19 +17,11 @@ module.exports = OutputFileFinder =
jobs = [] jobs = []
outputFiles = [] outputFiles = []
for file in allFiles for file in allFiles
do (file) -> if !incomingResources[file]
jobs.push (callback) ->
if incomingResources[file]
return callback()
else
outputFiles.push { outputFiles.push {
path: file path: file
type: file.match(/\.([^\.]+)$/)?[1] type: file.match(/\.([^\.]+)$/)?[1]
} }
callback()
async.series jobs, (error) ->
return callback(error) if error?
callback null, outputFiles callback null, outputFiles
_getAllFiles: (directory, _callback = (error, fileList) ->) -> _getAllFiles: (directory, _callback = (error, fileList) ->) ->