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

Don't remove from map while iterating over it #15957

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

ronawho
Copy link
Contributor

@ronawho ronawho commented Jun 26, 2020

You can't remove from a map while iterating over. Update the -= and
&= map implementations to avoid that.

You can't remove from a map while iterating over. Update the `-=` and
`&=` map implementations to avoid that.
@ronawho ronawho requested a review from daviditen June 26, 2020 18:45
@ronawho
Copy link
Contributor Author

ronawho commented Jun 26, 2020

@daviditen I ran into this while making some hash table optimizations. For now I just went with the simple fix for &= but I opened https://github.com/Cray/chapel-private/issues/1097 for potential optimizations.

Copy link
Member

@daviditen daviditen left a comment

Choose a reason for hiding this comment

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

Thanks!

@ronawho ronawho merged commit 693d151 into chapel-lang:master Jun 26, 2020
@ronawho ronawho deleted the fix-map-rm-while-iter branch June 26, 2020 20:42
ronawho added a commit that referenced this pull request Jun 29, 2020
Fix associative domain ^= to avoid removing while iterating

[reviewed by @mppf]

Fix a bug in the associative domain ^= implementation where we were
removing elements while iterating over it. Similar to #15957 and #15962
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