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

Optimize GetPlayerGraphicForSpell #7210

Conversation

kphoenix137
Copy link
Collaborator

Improves performance and maintainability by using a lookup table instead of switch-case conditions.

Improves performance and maintainability by using a lookup table instead of switch-case conditions.
@StephenCWills
Copy link
Member

I'm not sure that unordered_map is really going to perform better than the switch-case with just three options.

@kphoenix137
Copy link
Collaborator Author

I'm not sure that unordered_map is really going to perform better than the switch-case with just three options.

I'm sure the difference is negligible in this case. Which one is more user friendly for modification?

@StephenCWills
Copy link
Member

Which one is more user friendly for modification?

Neither. The code is all here in this one tiny method, and modification can be mostly a copy/paste job either way.

@kphoenix137
Copy link
Collaborator Author

Which one is more user friendly for modification?

Neither. The code is all here in this one tiny method, and modification can be mostly a copy/paste job either way.

Sounds good, I will close.

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