summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/IterableLike.scala
diff options
context:
space:
mode:
authorSom Snytt <som.snytt@gmail.com>2017-02-07 10:16:14 -0800
committerSom Snytt <som.snytt@gmail.com>2017-02-07 10:16:14 -0800
commit86889b2707c5ddc466ac198c19f01caad4679de6 (patch)
tree2cec031b4ac43b0f7bcf9366f90d8f822280b6d4 /src/library/scala/collection/IterableLike.scala
parent7311a29a992db1d3d16a73a9c49c80b0a4383103 (diff)
downloadscala-86889b2707c5ddc466ac198c19f01caad4679de6.tar.gz
scala-86889b2707c5ddc466ac198c19f01caad4679de6.tar.bz2
scala-86889b2707c5ddc466ac198c19f01caad4679de6.zip
Nuance doc for sliding
Attempt to clarify how final element is handled.
Diffstat (limited to 'src/library/scala/collection/IterableLike.scala')
-rw-r--r--src/library/scala/collection/IterableLike.scala12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala
index b89720da78..419206c226 100644
--- a/src/library/scala/collection/IterableLike.scala
+++ b/src/library/scala/collection/IterableLike.scala
@@ -177,14 +177,14 @@ self =>
}
/** Groups elements in fixed size blocks by passing a "sliding window"
- * over them (as opposed to partitioning them, as is done in grouped.)
- * "Sliding window" step is 1 by default.
+ * over them (as opposed to partitioning them, as is done in `grouped`.)
+ * The "sliding window" step is set to one.
* @see [[scala.collection.Iterator]], method `sliding`
*
* @param size the number of elements per group
* @return An iterator producing ${coll}s of size `size`, except the
- * last and the only element will be truncated if there are
- * fewer elements than size.
+ * last element (which may be the only element) will be truncated
+ * if there are fewer than `size` elements remaining to be grouped.
*/
def sliding(size: Int): Iterator[Repr] = sliding(size, 1)
@@ -196,8 +196,8 @@ self =>
* @param step the distance between the first elements of successive
* groups
* @return An iterator producing ${coll}s of size `size`, except the
- * last and the only element will be truncated if there are
- * fewer elements than size.
+ * last element (which may be the only element) will be truncated
+ * if there are fewer than `size` elements remaining to be grouped.
*/
def sliding(size: Int, step: Int): Iterator[Repr] =
for (xs <- iterator.sliding(size, step)) yield {