Skip to content

Commit 46bb107

Browse files
committed
remove some lower bounds in ArrayOps
1 parent 9a418c5 commit 46bb107

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

library/src/scala/collection/ArrayOps.scala

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -492,12 +492,11 @@ final class ArrayOps[A](val xs: Array[A]) extends AnyVal {
492492
/** Finds index of first occurrence of some value in this array after or at some start index.
493493
*
494494
* @param elem the element value to search for.
495-
* @tparam B the type of the element `elem`.
496495
* @param from the start index
497496
* @return the index `>= from` of the first element of this array that is equal (as determined by `==`)
498497
* to `elem`, or `-1`, if none exists.
499498
*/
500-
def indexOf[B >: A](elem: B, from: Int = 0): Int = {
499+
def indexOf(elem: A, from: Int = 0): Int = {
501500
var i = from
502501
while(i < xs.length) {
503502
if(elem == xs(i)) return i
@@ -526,11 +525,10 @@ final class ArrayOps[A](val xs: Array[A]) extends AnyVal {
526525
*
527526
* @param elem the element value to search for.
528527
* @param end the end index.
529-
* @tparam B the type of the element `elem`.
530528
* @return the index `<= end` of the last element of this array that is equal (as determined by `==`)
531529
* to `elem`, or `-1`, if none exists.
532530
*/
533-
def lastIndexOf[B >: A](elem: B, end: Int = xs.length - 1): Int = {
531+
def lastIndexOf(elem: A, end: Int = xs.length - 1): Int = {
534532
var i = min(end, xs.length-1)
535533
while(i >= 0) {
536534
if(elem == xs(i)) return i
@@ -1030,7 +1028,7 @@ final class ArrayOps[A](val xs: Array[A]) extends AnyVal {
10301028
* @return `true` if this array has an element that is equal (as
10311029
* determined by `==`) to `elem`, `false` otherwise.
10321030
*/
1033-
def contains[A1 >: A](elem: A1): Boolean = exists (_ == elem)
1031+
def contains(elem: A): Boolean = exists (_ == elem)
10341032

10351033
/** Returns a copy of this array with patched values.
10361034
* Patching at negative indices is the same as patching starting at 0.

0 commit comments

Comments
 (0)