diff --git a/Project.toml b/Project.toml index 1843563..f052806 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "VoronoiDelaunay" uuid = "72f80fcb-8c52-57d9-aff0-40c1a3526986" -version = "0.4.1" +version = "0.4.2" [deps] Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" diff --git a/src/VoronoiDelaunay.jl b/src/VoronoiDelaunay.jl index 823e19a..3f3b9b7 100644 --- a/src/VoronoiDelaunay.jl +++ b/src/VoronoiDelaunay.jl @@ -278,17 +278,22 @@ function voronoiedgeswithoutgenerators(t::DelaunayTessellation2D) VoronoiEdgeIteratorWithoutGenerator(t) end +# TODO: for v0.5, remove TrigIter +mutable struct TrigIter + ix::Int64 +end -function iterate(t::DelaunayTessellation2D, ix::Int=2) - while ix <= t._last_trig_index && isexternal(@inbounds t._trigs[ix]) - ix += 1 +# TODO: for v0.5, replace it by ix::Int +function iterate(t::DelaunayTessellation2D, it::TrigIter=TrigIter(2)) + while it.ix <= t._last_trig_index && isexternal(@inbounds t._trigs[it.ix]) + it.ix += 1 end - if ix > t._last_trig_index + if it.ix > t._last_trig_index return nothing end - trig = t._trigs[ix] - ix += 1 - return (trig, ix) + trig = t._trigs[it.ix] + it.ix += 1 + return (trig, it) end function findindex(tess::DelaunayTessellation2D{T}, p::T) where T<:AbstractPoint2D