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

Avoid infinite loop #44

Merged
merged 4 commits into from
Jan 18, 2024
Merged

Avoid infinite loop #44

merged 4 commits into from
Jan 18, 2024

Conversation

MJohnson459
Copy link
Contributor

@MJohnson459 MJohnson459 commented Jan 16, 2024

Workaround for #45.

In some cases I was getting an infinite loop happening. This PR adds a limit to the loop to avoid this situation.

I'm not sure what a reasonable value for the limit is. I chose the number of polygons as I'm assuming that checking every polygon should not happen in normal circumstances (is that true?).

Note that this doesn't fix the cause of the loop, it only adds a failure condition to avoid crashing.

@MJohnson459
Copy link
Contributor Author

Ok I hit a case where using self.polygons.len() was too small and exited early when it shouldn't have. I could just make this * 1000 but maybe there is a smarter way? Maybe that is fine for a quick band-aid while we look for the root cause.

src/lib.rs Outdated Show resolved Hide resolved
@mockersf mockersf added this pull request to the merge queue Jan 18, 2024
Merged via the queue into vleue:main with commit 9c3e11c Jan 18, 2024
4 checks passed
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