Skip to content

Commit 2bef7a6

Browse files
eliascarvsouma4
authored andcommitted
Remove unnecessary uses of collect (#1132)
* Remove unnecessary uses of 'collect' * Fix code * Remove comments
1 parent e81928e commit 2bef7a6

File tree

4 files changed

+3
-5
lines changed

4 files changed

+3
-5
lines changed

src/projecting.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ proj2D(r::Rope) = Ring(proj2D(vertices(r)))
1414

1515
proj2D(r::Ring) = Ring(proj2D(vertices(r)))
1616

17-
proj2D(p::Ngon) = Ngon(proj2D(collect(vertices(p)))...)
17+
proj2D(p::Ngon) = Ngon(proj2D(vertices(p)))
1818

1919
proj2D(p::PolyArea) = PolyArea(proj2D.(rings(p)))
2020

src/simplification/douglaspeucker.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ end
2424
DouglasPeuckerSimplification(τ) = DouglasPeuckerSimplification(addunit(τ, u"m"))
2525

2626
function simplify(chain::Chain, method::DouglasPeuckerSimplification)
27-
verts = _douglaspeucker(vertices(chain), method.τ) |> collect
27+
verts = _douglaspeucker(vertices(chain), method.τ)
2828
isclosed(chain) ? Ring(verts) : Rope(verts)
2929
end
3030

src/simplification/selinger.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ function simplify(chain::Chain, method::SelingerSimplification)
6969
end
7070
end
7171

72-
Ring(collect(v[bestpath[begin:(end - 1)]]))
72+
Ring(v[bestpath[begin:(end - 1)]])
7373
end
7474

7575
function dijkstra(I, s, t)

src/transforms/repair.jl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,6 @@ function apply(::Repair{8}, ring::Ring)
9898
Ring(v), nothing
9999
end
100100

101-
repair8(v) = repair8(collect(v))
102-
103101
repair8(v::AbstractVector) = repair8(CircularVector(v))
104102

105103
function repair8(v::CircularVector{<:Point})

0 commit comments

Comments
 (0)