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

attempt to fix infinite loop in isochrones generation #4547

Merged
merged 7 commits into from
Feb 9, 2024

Conversation

kevinkreiser
Copy link
Member

fixes #4546

we may still want to protect bresenhams separately but perhaps this is a start

@kevinkreiser
Copy link
Member Author

@munckymagik did you have time to give this code a try?

@munckymagik
Copy link

@kevinkreiser just tried it out now with my failing example and it now returns a response 🎉 ✅

@@ -17,10 +17,22 @@ constexpr float METRIC_PADDING = 10.f;
template <typename PrecisionT>
std::vector<GeoPoint<PrecisionT>> OriginEdgeShape(const std::vector<GeoPoint<PrecisionT>>& pts,
double distance_along) {
// just the endpoint really
if (distance_along == 0)
Copy link
Member Author

Choose a reason for hiding this comment

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

if you are snapped to the end of the edge we just return a segment of zero length at the end

Comment on lines 31 to 33
// skip 0 length segments
if (len == 0)
continue;
Copy link
Member Author

@kevinkreiser kevinkreiser Feb 9, 2024

Choose a reason for hiding this comment

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

this is not needed. if len is 0 then it cant change suffix_len which means it cant change the outcome of that if below and get in there and do a divide by 0.

@@ -1,4 +1,4 @@
name: syntax
name: lint
Copy link
Member Author

Choose a reason for hiding this comment

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

i prefer to call it like it is

Copy link
Member

@nilsnolde nilsnolde left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the additional comments!

@kevinkreiser kevinkreiser merged commit 129c55b into master Feb 9, 2024
7 of 9 checks passed
@kevinkreiser kevinkreiser deleted the kk_isochrone_infinite_loop branch February 9, 2024 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants