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

Simplify the Type method of the Geometry type #491

Merged
merged 2 commits into from
Feb 15, 2023

Conversation

peterstace
Copy link
Owner

Description

No need for the switch statement since we already have direct access to the geometry type. The switch statement is likely a remnant of extracting out geometry type (a long time ago). The only functional difference here is that if a Geometry is somehow constructed with an invalid geometry type (which should be impossible), then the Type method will no longer panic but instead just return the invalid geometry type.

Check List

Have you:

  • Added unit tests? Not needed, since there's no testable functional change.

  • Add cmprefimpl tests? (if appropriate?) N/A.

  • Updated release notes? (if appropriate?) N/A, not a change that's visible to users.

Related Issue

  • N/A

Benchmark Results

  • Skipped, since this definitely won't have a performance impact.

No need for the switch statement since we already have direct access to
the geometry type. The switch statement is likely a remnant of
extracting out geometry type (a _long_ time ago). The only functional
difference here is that if a Geometry is somehow constructed with an
invalid geometry type (which should be impossible), then the `Type`
method will no longer panic but instead just return the invalid geometry
type.
@peterstace peterstace self-assigned this Feb 14, 2023
Copy link
Collaborator

@albertteoh albertteoh left a comment

Choose a reason for hiding this comment

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

👍🏼

@peterstace
Copy link
Owner Author

Thanks for the review! 😁

@peterstace peterstace merged commit 799302d into master Feb 15, 2023
@peterstace peterstace deleted the simplify_geometry_type_method branch February 15, 2023 04:02
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.

None yet

2 participants