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

Use HashSet<T> instead of Dictionary<TKey, TValue> in CharacterMap<T> #394

Merged
merged 1 commit into from
Jan 31, 2020

Conversation

KrisVandermotten
Copy link
Contributor

@KrisVandermotten KrisVandermotten commented Jan 31, 2020

The CharacterMap<T> constructor counts the occurrence of each opening character, but doesn't use the actual count.

This PR replaces the Dictionary<char, int> by a HashSet<char>. The dictionary used to be indexed three or four times per iteration though the loop, the hashSet is indexed once per iteration.

@xoofx xoofx merged commit 1f9b706 into xoofx:master Jan 31, 2020
@KrisVandermotten KrisVandermotten deleted the charactermap branch February 1, 2020 10:04
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.

3 participants