Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Davies Liu committed Nov 12, 2014
1 parent 1715ee3 commit 0d9b256
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import java.util.{List => JList, ArrayList => JArrayList, Map => JMap, Collectio
import org.apache.spark.input.PortableDataStream

import scala.collection.JavaConversions._
import scala.collection.JavaConverters._
import scala.collection.mutable
import scala.language.existentials

Expand Down Expand Up @@ -762,11 +763,7 @@ private[spark] object PythonRDD extends Logging {
* A helper to convert java.util.List[Double] into Array[Double]
*/
def listToArrayDouble(list: JList[Double]): Array[Double] = {
val r = new Array[Double](list.size)
list.zipWithIndex.foreach {
case (v, i) => r(i) = v
}
r
list.asScala.toArray
}
}

Expand Down

0 comments on commit 0d9b256

Please sign in to comment.