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

Rename the triangles and vertices interface size() method to return an int. #3

Merged
merged 2 commits into from
Sep 9, 2023

Conversation

tinevez
Copy link
Collaborator

@tinevez tinevez commented Jul 4, 2023

Now the sizel() method returns a long. This should make it possible for a Vertices and Triangles implementation to implement a Mastodon interface.

Now the sizel() method returns a long. This should make it possible
for a Vertices and Triangles implementation to implement a Mastodon
interface.
@tinevez tinevez changed the title Rename the triangles class size() method to return an int. Rename the triangles and vertices interface size() method to return an int. Jul 5, 2023
Copy link
Member

@ctrueden ctrueden left a comment

Choose a reason for hiding this comment

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

Makes sense, better aligned with int size() of Java collections as well. My only suggestion would be to replace the places where sizel() is called and then downcasted to int, to instead use the size() method. Otherwise, no bounds checking is done in these cases, which could be error-prone. I'm approving the changes anyway though, because this is still strictly a step forward; the changes I suggest here could be done later.

everywhere it is sensible to do so.
@tinevez tinevez merged commit d4a4c11 into master Sep 9, 2023
1 check passed
@tinevez tinevez deleted the int-interface branch September 9, 2023 12:29
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