Skip to content

Chained hashmap iteration sometimes misses items even in sane use #2049

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

Closed
marijnh opened this issue Mar 23, 2012 · 0 comments
Closed

Chained hashmap iteration sometimes misses items even in sane use #2049

marijnh opened this issue Mar 23, 2012 · 0 comments

Comments

@marijnh
Copy link
Contributor

marijnh commented Mar 23, 2012

Where 'sane use' is defined as the iter body only overwriting the key that is currently being inspected, and not adding or removing any others.

In the following scenario:

  • Map is filled to a point where the next insert will trigger a grow/rehash
  • Iterate
  • Iteration body overwrites its current key

The insert method will rehash at this point, whether the inserted key is new or not. This will throw off the iteration and cause it to miss some key,value pairs.

Seems to be fixed by simply only rehashing when an actual insert occurred. Patch forthcoming.

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