Skip to content

Commit 16e9bc1

Browse files
authored
Merge pull request scala#6565 from szeiger/wip/stringops-overhaul
Make StringOps a pure value class
2 parents ee99980 + 7c68757 commit 16e9bc1

File tree

8 files changed

+1101
-234
lines changed

8 files changed

+1101
-234
lines changed

src/library/scala/collection/ArrayOps.scala

+3-3
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ object ArrayOps {
5454
var i = 0
5555
while(i < len) {
5656
val x = xs(i)
57-
if(p(x)) f(xs(i))
57+
if(p(x)) f(x)
5858
i += 1
5959
}
6060
}
@@ -352,12 +352,12 @@ final class ArrayOps[A](val xs: Array[A]) extends AnyVal {
352352
* Note: `c splitAt n` is equivalent to `(c take n, c drop n)`.
353353
*
354354
* @param n the position at which to split.
355-
* @return a pair of arrayss consisting of the first `n`
355+
* @return a pair of arrays consisting of the first `n`
356356
* elements of this array, and the other elements.
357357
*/
358358
def splitAt(n: Int): (Array[A], Array[A]) = (take(n), drop(n))
359359

360-
/** A pair of, first, all elements that satisfy prediacte `p` and, second, all elements that do not. */
360+
/** A pair of, first, all elements that satisfy predicate `p` and, second, all elements that do not. */
361361
def partition(p: A => Boolean): (Array[A], Array[A]) = {
362362
var res1, res2 = ArrayBuilder.make[A]
363363
var i = 0

0 commit comments

Comments
 (0)