Skip to content

Commit

Permalink
use last for the last element
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed Mar 15, 2014
1 parent db6cb30 commit cab9a52
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/src/main/scala/org/apache/spark/rdd/SlidingRDD.scala
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class SlidingRDD[T: ClassTag](@transient val parent: RDD[T], val windowSize: Int
i = j
}
// If the head of last partition has size w1, we also need to add this partition.
if (nextHeads(n1 - 1).size == w1) {
if (nextHeads.last.size == w1) {
partitions += new SlidingRDDPartition[T](partitionIndex, parentPartitions(n1), Seq.empty)
}
partitions.toArray
Expand Down

0 comments on commit cab9a52

Please sign in to comment.