Skip to content
Snippets Groups Projects
Commit 1d9788e4 authored by carlmartin's avatar carlmartin Committed by Andrew Or
Browse files

[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
parent 8773705f
No related branches found
No related tags found
No related merge requests found
......@@ -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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment