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
IdDict: support deletion, and support nothing
used as a key
#26839
Conversation
Tests? |
No, that shouldn't have an affect on this |
I believe that's the change that caused this. |
No, the bug is with the subsequent line ( |
You're right; it was a more general problem with deletion. |
src/table.c
Outdated
return &tab[index + 1]; | ||
if (key != jl_nothing) | ||
// `nothing` is our sentinel value for deletion, so need to keep searching if it's also our search key | ||
return NULL; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like dead code --- if tab[index + 1] == NULL
then key
must be nothing
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point (For comparison, I put an assert here in the other function. Just didn’t realize I had converged them after exploring some alternative ways of expressing this.)
8273676
to
d3d58b4
Compare
previously, if we deleted one key or added `nothing` as a key, we might lose some of the other entries too (until rehash) fix #26833
d3d58b4
to
5e57c21
Compare
No description provided.