spark-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From andrewo...@apache.org
Subject spark git commit: [Minor] Improve some code in BroadcastTest for short
Date Mon, 22 Dec 2014 20:14:39 GMT
Repository: spark
Updated Branches:
  refs/heads/branch-1.2 70e69ef7b -> c7396b588


[Minor] Improve some code in BroadcastTest for short

Using
    val arr1 = (0 until num).toArray
instead of
    val arr1 = new Array[Int](num)
    for (i <- 0 until arr1.length) {
      arr1(i) = i
    }
for short.

Author: carlmartin <carlmartinmax@gmail.com>

Closes #3750 from SaintBacchus/BroadcastTest and squashes the following commits:

43adb70 [carlmartin] Improve some code in BroadcastTest for short


Project: http://git-wip-us.apache.org/repos/asf/spark/repo
Commit: http://git-wip-us.apache.org/repos/asf/spark/commit/c7396b58
Tree: http://git-wip-us.apache.org/repos/asf/spark/tree/c7396b58
Diff: http://git-wip-us.apache.org/repos/asf/spark/diff/c7396b58

Branch: refs/heads/branch-1.2
Commit: c7396b5887afe1bbe344ffcf06ef266847c378ac
Parents: 70e69ef
Author: carlmartin <carlmartinmax@gmail.com>
Authored: Mon Dec 22 12:13:53 2014 -0800
Committer: Andrew Or <andrew@databricks.com>
Committed: Mon Dec 22 12:14:33 2014 -0800

----------------------------------------------------------------------
 .../main/scala/org/apache/spark/examples/BroadcastTest.scala    | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/spark/blob/c7396b58/examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala
----------------------------------------------------------------------
diff --git a/examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala b/examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala
index 973049b..adecd93 100644
--- a/examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala
+++ b/examples/src/main/scala/org/apache/spark/examples/BroadcastTest.scala
@@ -38,10 +38,7 @@ object BroadcastTest {
     val slices = if (args.length > 0) args(0).toInt else 2
     val num = if (args.length > 1) args(1).toInt else 1000000
 
-    val arr1 = new Array[Int](num)
-    for (i <- 0 until arr1.length) {
-      arr1(i) = i
-    }
+    val arr1 = (0 until num).toArray
 
     for (i <- 0 until 3) {
       println("Iteration " + i)


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@spark.apache.org
For additional commands, e-mail: commits-help@spark.apache.org


Mime
View raw message