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 switch-case to if-else in UtcDateTypeAdapter #2760

Conversation

panic08
Copy link
Contributor

@panic08 panic08 commented Oct 13, 2024

The current implementation of the read() method uses a switch-case construct that is not needed to handle only two cases. To improve the readability and maintainability of the code, I suggest refactoring into a simpler if-else structure

Copy link
Member

@eamonnmcmanus eamonnmcmanus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems fair.

@eamonnmcmanus eamonnmcmanus merged commit 23bf512 into google:main Oct 14, 2024
11 checks passed
@panic08 panic08 deleted the refactor-switch-to-if-in-utc-date-type-adapter branch October 15, 2024 16:42
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