Skip to content

Commit cab9a52

Browse files
committed
use last for the last element
1 parent db6cb30 commit cab9a52

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/org/apache/spark/rdd/SlidingRDD.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ class SlidingRDD[T: ClassTag](@transient val parent: RDD[T], val windowSize: Int
9090
i = j
9191
}
9292
// If the head of last partition has size w1, we also need to add this partition.
93-
if (nextHeads(n1 - 1).size == w1) {
93+
if (nextHeads.last.size == w1) {
9494
partitions += new SlidingRDDPartition[T](partitionIndex, parentPartitions(n1), Seq.empty)
9595
}
9696
partitions.toArray

0 commit comments

Comments
 (0)