|
results = Vector{Int}(undef, max_points + (preserve_endpoint ? 0 : 1)) |
|
results[1], results[2] = 1, npoints |
|
# Loop through points until stopping criteria are fulfilled |
|
i = 2 # already have first and last point added |
|
start_idx, end_idx = 1, npoints |
|
max_idx, max_dist = _find_max_squared_dist(points, start_idx, end_idx) |
|
while i ≤ min(MIN_POINTS + 1, max_points) || (i < max_points && max_dist > max_tol) |
|
# Add next point to results |
|
i += 1 |
|
results[i] = max_idx |
In the referenced lines, the i+=1 can cause a BoundsError in the line below it, as the while loop allows for max_points number. I hit this during a normal simplify(x, tol=y) operation.
GeometryOps.jl/src/transformations/simplify.jl
Lines 298 to 307 in 769c3e1
In the referenced lines, the
i+=1can cause aBoundsErrorin the line below it, as the while loop allows formax_pointsnumber. I hit this during a normalsimplify(x, tol=y)operation.