8000 Merge pull request scala/scala#10992 from mlutze/patch-1 · scala/scala3@21fd74a · GitHub
[go: up one dir, main page]

Skip to content

Commit 21fd74a

Browse files
authored
Merge pull request scala/scala#10992 from mlutze/patch-1
add documentation for Iterator.indexWhere
2 parents 7458a28 + c0b9600 commit 21fd74a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

library/src/scala/collection/Iterator.scala

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,17 @@ trait Iterator[+A] extends IterableOnce[A] with IterableOnceOps[A, Iterator, Ite
413413

414414
@deprecated("Call scanRight on an Iterable instead.", "2.13.0")
415415
def scanRight[B](z: B)(op: (A, B) => B): Iterator[B] = ArrayBuffer.from(this).scanRight(z)(op).iterator
416-
416+
417+
/** Finds index of the first element satisfying some predicate after or at some start index.
418+
*
419+
* $mayNotTerminateInf
420+
*
421+
* @param p the predicate used to test elements.
422+
* @param from the start index
423+
* @return the index `>= from` of the first element of this $coll that satisfies the predicate `p`,
424+
* or `-1`, if none exists.
425+
* @note Reuse: $consumesIterator
426+
*/
417427
def indexWhere(p: A => Boolean, from: Int = 0): Int = {
418428
var i = math.max(from, 0)
419429
val dropped = drop(from)

0 commit comments

Comments
 (0)
0