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

Refactor TypeDictionary #8625

Merged
merged 1 commit into from Jul 5, 2015
Merged

Conversation

RoosterDragon
Copy link
Member

Fix a couple of potential bugs:

  • When removing entries, ensure the dictionary entry is removed is the list is emptied, to prevent incorrect lookups later.
  • Prevent NRE when calling GetOrDefault where T is a value type and the default is returned.

General code cleanup:

  • Use a single dictionary for simplicity and improved lookup performance (since there is only one dictionary to check).
  • De-duplicate code in Get and GetOrDefault.

- When removing entries, ensure the dictionary entry is removed is the list is emptied, to prevent incorrect lookups later.
- Prevent NRE when calling GetOrDefault<T> where T is a value type and the default is returned.
- Use a single dictionary for simplicity and improved lookup performance (since there is only one dictionary to check).
- De-duplicate code in Get and GetOrDefault.
@Mailaender
Copy link
Member

Can't spot regressions in-game. ✅

@penev92
Copy link
Member

penev92 commented Jul 5, 2015

Code looks good and game still works 👍

I have no idea how to changelog this though.

penev92 added a commit that referenced this pull request Jul 5, 2015
@penev92 penev92 merged commit 3a3d628 into OpenRA:bleed Jul 5, 2015
@penev92
Copy link
Member

penev92 commented Jul 5, 2015

Changelog

@RoosterDragon RoosterDragon deleted the type-dict-refactor branch July 6, 2015 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants