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

Remove switches and catch bad values #631

Merged
merged 1 commit into from
Sep 27, 2024
Merged

Remove switches and catch bad values #631

merged 1 commit into from
Sep 27, 2024

Conversation

tpadioleau
Copy link
Member

@tpadioleau tpadioleau commented Sep 7, 2024

  • turn switches into if/else blocks
  • remove duplicate switches in compute_block_sizes_* functions

@tpadioleau tpadioleau marked this pull request as ready for review September 9, 2024 16:49
@tpadioleau tpadioleau self-assigned this Sep 9, 2024
@tpadioleau tpadioleau force-pushed the remove-switches branch 3 times, most recently from fece6bb to 768cff3 Compare September 24, 2024 19:46
@EmilyBourne
Copy link
Collaborator

Why do you prefer if/else over switches?

@tpadioleau
Copy link
Member Author

tpadioleau commented Sep 27, 2024

Why do you prefer if/else over switches?

I find it old construct from the language, less obvious to implement correctly. We used to have a bug about a missing break statement

@tpadioleau tpadioleau merged commit eb96658 into main Sep 27, 2024
56 checks passed
@tpadioleau tpadioleau deleted the remove-switches branch September 27, 2024 11:48
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