Skip to content

Commit

Permalink
use traditional for loop instead of Array.forEach() for better perfor…
Browse files Browse the repository at this point in the history
…mance
  • Loading branch information
manidlou committed Feb 17, 2017
1 parent e2ccf48 commit db694e5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.1.2 / 2017-02-17
------------------

- Changed to traditional for loop instead of using Array.forEach() because of better performance.

1.1.1 / 2017-02-05
------------------

Expand Down
10 changes: 5 additions & 5 deletions klaw-sync.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,15 @@ function walkSync (dir, opts, list) {
} catch (er) {
throw er
}
files.forEach(function (file) {

for (var i = 0; i < files.length; i += 1) {
var file = files[i]
if (ignore.length > 0) {
if (ignore.indexOf(file) === -1) {
_procPath(dir, file, opts, list)
}
if (ignore.indexOf(file) === -1) _procPath(dir, file, opts, list)
} else {
_procPath(dir, file, opts, list)
}
})
}
return list
}

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "klaw-sync",
"version": "1.1.1",
"description": "Recursive and synchronous file system walker",
"description": "Recursive, synchronous, and fast file system walker",
"main": "klaw-sync.js",
"repository": {
"type": "git",
Expand Down

0 comments on commit db694e5

Please sign in to comment.