aboutsummaryrefslogtreecommitdiff
path: root/mllib
diff options
context:
space:
mode:
authorMatei Zaharia <matei@eecs.berkeley.edu>2013-07-31 11:28:39 -0700
committerMatei Zaharia <matei@eecs.berkeley.edu>2013-07-31 11:28:39 -0700
commit9a444cffe74374f0d764d1ed8197423e40529f24 (patch)
tree16eee1d1ed48f4d4da8685409934a5f8d29829b8 /mllib
parenta386ced2c6cfec4199e4c5e2ede38ca5154544af (diff)
downloadspark-9a444cffe74374f0d764d1ed8197423e40529f24.tar.gz
spark-9a444cffe74374f0d764d1ed8197423e40529f24.tar.bz2
spark-9a444cffe74374f0d764d1ed8197423e40529f24.zip
Use the Char version of split() instead of the String one for efficiency
Diffstat (limited to 'mllib')
-rw-r--r--mllib/src/main/scala/spark/mllib/util/MLUtils.scala4
1 files changed, 2 insertions, 2 deletions
diff --git a/mllib/src/main/scala/spark/mllib/util/MLUtils.scala b/mllib/src/main/scala/spark/mllib/util/MLUtils.scala
index b5e564df6d..25d9673004 100644
--- a/mllib/src/main/scala/spark/mllib/util/MLUtils.scala
+++ b/mllib/src/main/scala/spark/mllib/util/MLUtils.scala
@@ -38,9 +38,9 @@ object MLUtils {
*/
def loadLabeledData(sc: SparkContext, dir: String): RDD[(Double, Array[Double])] = {
sc.textFile(dir).map { line =>
- val parts = line.split(",")
+ val parts = line.split(',')
val label = parts(0).toDouble
- val features = parts(1).trim().split(" ").map(_.toDouble)
+ val features = parts(1).trim().split(' ').map(_.toDouble)
(label, features)
}
}