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

Replace small dictionaries with switch #2744

Merged
merged 1 commit into from
Aug 19, 2024

Conversation

jnyrup
Copy link
Contributor

@jnyrup jnyrup commented Aug 18, 2024

Instead of initializing and looking up values in small dictionaries, it's faster to simply use a switch expression and we can also (I would say) better name the lookup methods.

I implemented them as private static functions, but they also have been static local functions.

@kblok
Copy link
Member

kblok commented Aug 19, 2024

Love it!

@kblok kblok merged commit c4df9a1 into hardkoded:master Aug 19, 2024
12 checks passed
@jnyrup jnyrup deleted the dictionary2switch branch August 19, 2024 12:14
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