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

User for...in instead of for loop in iterate function #26

Open
davebriand opened this issue Jul 14, 2014 · 0 comments
Open

User for...in instead of for loop in iterate function #26

davebriand opened this issue Jul 14, 2014 · 0 comments

Comments

@davebriand
Copy link

I think it would be common to use store.remove inside store.iterate. If a for..in loop was used we could iterate and remove/delete keys.

Edit:
The issue is that currently a for loop is used, and as the number of keys changes (ie during a remove) so does the referenced length value, which means we won't be iterating through the entire collection. A for...in loop will iterate over all items in the collection even after a delete since it doesn't depend on the length of the collection.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant