Skip to content

Commit 6cc2551

Browse files
committed
change foreach to for
1 parent eb39b08 commit 6cc2551

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/Partitioner.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ class RangePartitioner[K : Ordering : ClassTag, V](
136136
} else {
137137
// The weight is 1 over the sampling probability.
138138
val weight = (n.toDouble / sample.size).toFloat
139-
sample.foreach { key =>
139+
for (key <- sample) {
140140
candidates += ((key, weight))
141141
}
142142
}

0 commit comments

Comments
 (0)