Skip to content

Commit

Permalink
[Minor] Improve some code in BroadcastTest for short
Browse files Browse the repository at this point in the history
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 <[email protected]>

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

43adb70 [carlmartin] Improve some code in BroadcastTest for short
  • Loading branch information
SaintBacchus authored and Andrew Or committed Dec 22, 2014
1 parent 8773705 commit 1d9788e
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1d9788e

Please sign in to comment.