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

STYLE: Remove unreachable code #4980

Conversation

hjmjohnson
Copy link
Member

The value of m_PQcount is always explicitly set to zero. Remove conditional code that depends on the value of m_PQcount not being zero.

PR Checklist

The value of m_PQcount is always explicitly set to zero.  Remove conditional code that depends on the value of m_PQcount not being zero.
@hjmjohnson hjmjohnson added the type:Style Style changes: no logic impact (indentation, comments, naming) label Nov 22, 2024
@hjmjohnson hjmjohnson self-assigned this Nov 22, 2024
@github-actions github-actions bot added the area:Segmentation Issues affecting the Segmentation module label Nov 22, 2024
Comment on lines -1076 to -1088
PointType currentCircle{};
FortuneHalfEdge * leftHalfEdge;
FortuneHalfEdge * rightHalfEdge;
FortuneHalfEdge * left2HalfEdge;
FortuneHalfEdge * right2HalfEdge;
FortuneHalfEdge * newHE;
FortuneSite * findSite;
FortuneSite * topSite;
FortuneSite * saveSite;
FortuneEdge * newEdge;
FortuneSite * meetSite;
FortuneSite * newVert;
bool saveBool;
Copy link
Contributor

Choose a reason for hiding this comment

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

First of all, I like style commits that remove unused code 👍 Do you possibly have an explanation, why so much of the code of VoronoiDiagram2DGenerator seems unused or useless? Is it unfinished work?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please consider a more specific commit message header, for example:

STYLE: Remove unreachable code from Voronoi GenerateVDFortune

Copy link
Member

@dzenanz dzenanz left a comment

Choose a reason for hiding this comment

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

There are some methods, such as deletePQ, which modify m_PQcount. They are invoked, e.g. from here:
https://github.com/InsightSoftwareConsortium/ITK/blob/v5.4.0/Modules/Segmentation/Voronoi/include/itkVoronoiDiagram2DGenerator.hxx#L1137
So this code refactoring seems overly aggressive.

@hjmjohnson
Copy link
Member Author

Abandoning. Static analysis indicated that this was unused code, and a review of this file verified that. local quick test passed, but perhaps that did not hit this codebase.

@hjmjohnson hjmjohnson closed this Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:Segmentation Issues affecting the Segmentation module type:Style Style changes: no logic impact (indentation, comments, naming)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants