You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a panic in our production (which uses kurbo for the analytic nearst point calculation). Looking at the code, the only way it can panic is if the cubic solver returned no solutions. This can happen if the cubic is in fact a quadratic or only a constant, which theoretically cannot happen but in practice can if a number is rounded to 0.
So I propose that we add a check so that if there are no roots then we check the ends of the curve. Because this branch will be very rarely hit in practice, iterating over a lot of curves shouldn't be slowed (due to branch prediction) although of course it depends on what the hardware does and so benchmarking is probably in order.
I had a panic in our production (which uses
kurbo
for the analytic nearst point calculation). Looking at the code, the only way it can panic is if the cubic solver returned no solutions. This can happen if the cubic is in fact a quadratic or only a constant, which theoretically cannot happen but in practice can if a number is rounded to 0.So I propose that we add a check so that if there are no roots then we check the ends of the curve. Because this branch will be very rarely hit in practice, iterating over a lot of curves shouldn't be slowed (due to branch prediction) although of course it depends on what the hardware does and so benchmarking is probably in order.
Example modification that ensures
r_best
isSome
:The text was updated successfully, but these errors were encountered: