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

Deleting specific keys from ordered table leaves it in invalid state. #5057

Closed
yglukhov opened this issue Nov 25, 2016 · 1 comment
Closed

Comments

@yglukhov
Copy link
Member

import tables

# The bug is reproducible only with exact keys
const key1 = "boy_jackpot.inGamma"
const key2 = "boy_jackpot.outBlack"

var t = {
    key1: 0,
    key2: 0
}.toOrderedTable()

assert(key2 in t) # Passes
t.del(key1)
echo t # Prints {boy_jackpot.outBlack: 0}
assert(key2 in t) # Fails

Arch: amd64. This is not a recent regression. More likely the bug existed since i've first introduced del for OrderedTable.

@yglukhov
Copy link
Member Author

Looks like del impl for OrderedTable is flawed because it doesn't account for collision clusters.

@Araq Araq closed this as completed in 4120549 Nov 27, 2016
Araq added a commit that referenced this issue Nov 27, 2016
yglukhov added a commit to yglukhov/Nim that referenced this issue Nov 27, 2016
Araq added a commit that referenced this issue Nov 28, 2016
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