@@ -559,8 +559,8 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
559
559
560
560
/** Selects all elements of this array which do not satisfy a predicate.
561
561
*
562
- * @param pred the predicate used to test elements.
563
- * @return a new array consisting of all elements of this array that do not satisfy the given predicate `pred `.
562
+ * @param p the predicate used to test elements.
563
+ * @return a new array consisting of all elements of this array that do not satisfy the given predicate `p `.
564
564
*/
565
565
def filterNot (p : A => Boolean ): Array [A ] = filter(x => ! p(x))
566
566
@@ -678,10 +678,10 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
678
678
* @return the index `>= from` of the first element of this array that satisfies the predicate `p`,
679
679
* or `-1`, if none exists.
680
680
*/
681
- def indexWhere (f : A => Boolean , from : Int = 0 ): Int = {
681
+ def indexWhere (@ deprecatedName( " f " , " 2.13.3 " ) p : A => Boolean , from : Int = 0 ): Int = {
682
682
var i = from
683
683
while (i < xs.length) {
684
- if (f (xs(i))) return i
684
+ if (p (xs(i))) return i
685
685
i += 1
686
686
}
687
687
- 1
@@ -724,8 +724,8 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
724
724
* @return an option value containing the first element in the array
725
725
* that satisfies `p`, or `None` if none exists.
726
726
*/
727
- def find (f : A => Boolean ): Option [A ] = {
728
- val idx = indexWhere(f )
727
+ def find (@ deprecatedName( " f " , " 2.13.3 " ) p : A => Boolean ): Option [A ] = {
728
+ val idx = indexWhere(p )
729
729
if (idx == - 1 ) None else Some (xs(idx))
730
730
}
731
731
@@ -734,18 +734,18 @@ final class ArrayOps[A](private val xs: Array[A]) extends AnyVal {
734
734
* @param p the predicate used to test elements.
735
735
* @return `true` if the given predicate `p` is satisfied by at least one element of this array, otherwise `false`
736
736
*/
737
- def exists (f : A => Boolean ): Boolean = indexWhere(f ) >= 0
737
+ def exists (@ deprecatedName( " f " , " 2.13.3 " ) p : A => Boolean ): Boolean = indexWhere(p ) >= 0
738
738
739
739
/** Tests whether a predicate holds for all elements of this array.
740
740
*
741
741
* @param p the predicate used to test elements.
742
742
* @return `true` if this array is empty or the given predicate `p`
743
743
* holds for all elements of this array, otherwise `false`.
744
744
*/
745
- def forall (f : A => Boolean ): Boolean = {
745
+ def forall (@ deprecatedName( " f " , " 2.13.3 " ) p : A => Boolean ): Boolean = {
746
746
var i = 0
747
747
while (i < xs.length) {
748
- if (! f (xs(i))) return false
748
+ if (! p (xs(i))) return false
749
749
i += 1
750
750
}
751
751
true
0 commit comments