Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for #17 #42

Merged
merged 1 commit into from
Feb 23, 2015
Merged

Fix for #17 #42

merged 1 commit into from
Feb 23, 2015

Conversation

silkentrance
Copy link
Collaborator

The only problem that remains is that of available memory if the user managed to create so many directories and subdirectories that we eat up the memory while pushing the strings unto the stack...

function _rmdirRecursiveSync(root) {
var dirs = [];
dirs.push(root);
while (dirs.length) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not a simple:

var
  dirs = [],
  dir;
while(dir = dirs.pop) {
  // ...
}

@silkentrance
Copy link
Collaborator Author

@raszi Did a rebase to master and fixed the issues you pointed out.

raszi added a commit that referenced this pull request Feb 23, 2015
@raszi raszi merged commit d3bbc86 into raszi:master Feb 23, 2015
@silkentrance silkentrance deleted the gh-17 branch February 23, 2015 21:29
raszi added a commit that referenced this pull request May 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should _rmdirRecursiveSync be re-implemented using a loop?
2 participants