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

Bug in RemoveAt function #1

Open
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

MarkEHenderson
Copy link

Hey, just wanted to comment that I ran into a bug with the removeAt function.

If you have a dictionary with 2 entries, and you remove the 2nd one, removeAt will not correctly remove it from the _cache. It removes it at the start of the function, but re adds it in the if(_keys.Count > 1) block.

I fixed the problem by adding "&& index != _keys.Count-1" to the if statement

( I should mention that after this happened, TryGetValue would return an error when trying to get the removed value, which caused me quite a few problems)

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