Check recurse flag before verifying path is directory

Avoid an unnecessary native call if recursing into the current
path has already been avoided.
This commit is contained in:
Kevin Sawicki
2012-10-08 11:46:07 -07:00
parent f6c29a1d51
commit 7ab088df8b

View File

@@ -109,7 +109,7 @@ module.exports =
for path in @list(rootPath)
recurse = true
fn(path, prune)
@traverseTree(path, fn) if @isDirectory(path) and recurse
@traverseTree(path, fn) if recurse and @isDirectory(path)
lastModified: (path) ->
$native.lastModified(path)