JuliaGeometry / GeometryBasics.jl

Basic Geometry Types
MIT License
165 stars 54 forks source link

less `push!` in collect_with_eltype #188

Closed rafaqz closed 1 year ago

rafaqz commented 1 year ago

This PR reduces the use of push! in collect_with_eltype.

Unfortunately it's not as good as it could be, because we don't know the eltype of our iterator. Even when it is constant eltype(iter) is Any. It may be worth writing a custom iterator that keeps eltype.