Skip to content

Commit 1b89d1f

Browse files
authored
Merge pull request scala/scala#6945 from xuwei-k/ArrayOps-collect-doc
fix ArrayOps#collect parameter name
2 parents e102805 + af6ced5 commit 1b89d1f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/src/scala/collection/ArrayOps.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,7 +848,7 @@ final class ArrayOps[A](val xs: Array[A]) extends AnyVal {
848848
* `pf` to each element on which it is defined and collecting the results.
849849
* The order of the elements is preserved.
850850
*/
851-
def collect[B : ClassTag](f: PartialFunction[A, B]): Array[B] = {
851+
def collect[B : ClassTag](pf: PartialFunction[A, B]): Array[B] = {
852852
var i = 0
853853
var matched = true
854854
def d(x: A): B = {
@@ -858,7 +858,7 @@ final class ArrayOps[A](val xs: Array[A]) extends AnyVal {
858858
val b = ArrayBuilder.make[B]
859859
while(i < xs.length) {
860860
matched = true
861-
val v = f.applyOrElse(xs(i), d)
861+
val v = pf.applyOrElse(xs(i), d)
862862
if(matched) b += v
863863
i += 1
864864
}

0 commit comments

Comments
 (0)