Skip to content
Permalink
Browse files

Avoid extraneous cloning

jts.Point.getPointN already creates a new Point instance from the
underlying Coordinate; no need to clone it.
  • Loading branch information
mojodna authored and echeipesh committed Apr 2, 2018
1 parent 854f967 commit 915c14ce7c618eaeaeceb2309190b92509bc5fcc
Showing with 1 addition and 2 deletions.
  1. +1 −2 vector/src/main/scala/geotrellis/vector/Line.scala
@@ -96,8 +96,7 @@ case class Line(jtsGeom: jts.LineString) extends Geometry
val size = jtsGeom.getNumPoints
val arr = Array.ofDim[Point](size)
cfor(0)(_ < arr.size, _ + 1) { i =>
val p = jtsGeom.getPointN(i).clone.asInstanceOf[jts.Point]
arr(i) = Point(p)
arr(i) = Point(jtsGeom.getPointN(i))
}
arr
}

0 comments on commit 915c14c

Please sign in to comment.
You can’t perform that action at this time.