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

Redundant Validity Checks in Flood Fill Julia and C Implementations #765

Closed
lazyprop opened this issue Oct 13, 2020 · 2 comments
Closed

Comments

@lazyprop
Copy link
Contributor

In the Julia and C implementations, the color function checks if the point is inside bounds and if old_val == new_val.
These conditions are already checked in the find_neighbours function. So the points which are passed to color will always satisfy these conditions.The conditions are totally unnecessary.
color can simply be:

def color(canvas, p, new_val):
    canvas[p] = new_val
@lazyprop
Copy link
Contributor Author

#752, and #743 have the same problem.

@lazyprop
Copy link
Contributor Author

I think this issue has been fixed in all the implementations. I will close this now.

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

No branches or pull requests

1 participant