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

Dead code in static filter Power_side_of_oriented_power_sphere_3 #7718

Closed
mglisse opened this issue Sep 17, 2023 · 2 comments · Fixed by #7810
Closed

Dead code in static filter Power_side_of_oriented_power_sphere_3 #7718

mglisse opened this issue Sep 17, 2023 · 2 comments · Fixed by #7810

Comments

@mglisse
Copy link
Member

mglisse commented Sep 17, 2023

https://github.com/CGAL/cgal/blame/187409888bd8590ad71f2a4912f53d9014a6cc27/Filtered_kernel/include/CGAL/Filtered_kernel/internal/Static_filters/Power_side_of_oriented_power_sphere_3.h#L374
As far as I can see, int_tmp_result can only be ±1 (line 348 or 354), and cmp is a copy, so the comparison cmp!=0 should always be true. Since the if branch ends with a return, this suggests that the next 170 lines are unreachable. Did I misread the code?
(if I was more serious, I would add an assertion and run some tests to confirm, or check if there is a coverage report of CGAL's testsuite somewhere online)
See also #2067 since this is the version with 4 points.

@MaelRL
Copy link
Member

MaelRL commented Sep 18, 2023

Smells like #5207?

@mglisse
Copy link
Member Author

mglisse commented Sep 18, 2023

Ah, yes, same generator, similar strange code for another predicate. I had completely forgotten about #5207.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants