Scala version: 2.13.16
- Implementation of
indexOfSlice in SeqOps is not overriden in IndexedSeqOps.
- Neither it is overriden in
Vector or ArraySeq
- If either the argument's or
this's knownSize is negative, the default implementation recursively calls this.tail.
Problem
The operation is needlessly expensive for anything but List, being even O(n^3) for ArraySeq!
This should be implemented using an iterator.
Scala version: 2.13.16
indexOfSliceinSeqOpsis not overriden inIndexedSeqOps.VectororArraySeqthis'sknownSizeis negative, the default implementation recursively calls this.tail.Problem
The operation is needlessly expensive for anything but
List, being evenO(n^3)forArraySeq!This should be implemented using an iterator.