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

forEach iterates over all entries when an entry is deleted #44

Closed
wants to merge 1 commit into from

Conversation

timjk
Copy link
Contributor

@timjk timjk commented Apr 14, 2015

forEach now continues if an item is deleted from the cache whilst iterating over it, fixing issue #33.

A consequence of this change is if one adds an entry during the forEach it will not be iterated over. If this behaviour is wanted a check could be added sometime after the fn.call(...) inside the for loop e.g.

if (this._itemCount > itemCount) {
  itemCount = this._itemCount
}

@isaacs
Copy link
Owner

isaacs commented Apr 15, 2015

Thanks, landed on master.

@isaacs isaacs closed this Apr 15, 2015
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

Successfully merging this pull request may close these issues.

2 participants