diff options
Diffstat (limited to 'src/library')
10 files changed, 15 insertions, 15 deletions
diff --git a/src/library/scala/collection/IterableLike.scala b/src/library/scala/collection/IterableLike.scala index a621572061..d5e1dd53db 100644 --- a/src/library/scala/collection/IterableLike.scala +++ b/src/library/scala/collection/IterableLike.scala @@ -202,7 +202,7 @@ self => b.sizeHintBounded(n, this) val lead = this.iterator drop n var go = false - for (x <- this.seq) { + for (x <- this) { if (lead.hasNext) lead.next() else go = true if (go) b += x diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala index c02ea98914..189dce49b7 100644 --- a/src/library/scala/collection/SeqLike.scala +++ b/src/library/scala/collection/SeqLike.scala @@ -273,7 +273,7 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[ def reverseMap[B, That](f: A => B)(implicit bf: CanBuildFrom[Repr, B, That]): That = { var xs: List[A] = List() - for (x <- this.seq) + for (x <- this) xs = x :: xs val b = bf(repr) for (x <- xs) @@ -478,7 +478,7 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[ private def occCounts[B](sq: Seq[B]): mutable.Map[B, Int] = { val occ = new mutable.HashMap[B, Int] { override def default(k: B) = 0 } - for (y <- sq.seq) occ(y) += 1 + for (y <- sq) occ(y) += 1 occ } @@ -608,7 +608,7 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[ val len = this.length val arr = new ArraySeq[A](len) var i = 0 - for (x <- this.seq) { + for (x <- this) { arr(i) = x i += 1 } diff --git a/src/library/scala/collection/TraversableLike.scala b/src/library/scala/collection/TraversableLike.scala index 00f4de82cd..f02c00a312 100644 --- a/src/library/scala/collection/TraversableLike.scala +++ b/src/library/scala/collection/TraversableLike.scala @@ -481,7 +481,7 @@ trait TraversableLike[+A, +Repr] extends Any var follow = false val b = newBuilder b.sizeHint(this, -1) - for (x <- this.seq) { + for (x <- this) { if (follow) b += lst else follow = true lst = x @@ -506,7 +506,7 @@ trait TraversableLike[+A, +Repr] extends Any private[this] def sliceInternal(from: Int, until: Int, b: Builder[A, Repr]): Repr = { var i = 0 breakable { - for (x <- this.seq) { + for (x <- this) { if (i >= from) b += x i += 1 if (i >= until) break diff --git a/src/library/scala/collection/TraversableOnce.scala b/src/library/scala/collection/TraversableOnce.scala index 2fdad0f8f9..26af32046c 100644 --- a/src/library/scala/collection/TraversableOnce.scala +++ b/src/library/scala/collection/TraversableOnce.scala @@ -97,7 +97,7 @@ trait TraversableOnce[+A] extends Any with GenTraversableOnce[A] { // for internal use protected[this] def reversed = { var elems: List[A] = Nil - self.seq foreach (elems ::= _) + self foreach (elems ::= _) elems } @@ -140,7 +140,7 @@ trait TraversableOnce[+A] extends Any with GenTraversableOnce[A] { def foldLeft[B](z: B)(op: (B, A) => B): B = { var result = z - this.seq foreach (x => result = op(result, x)) + this foreach (x => result = op(result, x)) result } diff --git a/src/library/scala/collection/generic/Growable.scala b/src/library/scala/collection/generic/Growable.scala index 254d4566be..a223c0c8a8 100644 --- a/src/library/scala/collection/generic/Growable.scala +++ b/src/library/scala/collection/generic/Growable.scala @@ -54,7 +54,7 @@ trait Growable[-A] extends Clearable { loop(xs.tail) } } - xs.seq match { + xs match { case xs: scala.collection.LinearSeq[_] => loop(xs) case xs => xs foreach += } diff --git a/src/library/scala/collection/generic/Shrinkable.scala b/src/library/scala/collection/generic/Shrinkable.scala index b5ec568667..dea5bb7217 100644 --- a/src/library/scala/collection/generic/Shrinkable.scala +++ b/src/library/scala/collection/generic/Shrinkable.scala @@ -46,5 +46,5 @@ trait Shrinkable[-A] { * @param xs the iterator producing the elements to remove. * @return the $coll itself */ - def --=(xs: TraversableOnce[A]): this.type = { xs.seq foreach -= ; this } + def --=(xs: TraversableOnce[A]): this.type = { xs foreach -= ; this } } diff --git a/src/library/scala/collection/immutable/DefaultMap.scala b/src/library/scala/collection/immutable/DefaultMap.scala index ce34b84486..e9b277b9c4 100755 --- a/src/library/scala/collection/immutable/DefaultMap.scala +++ b/src/library/scala/collection/immutable/DefaultMap.scala @@ -46,7 +46,7 @@ trait DefaultMap[A, +B] extends Map[A, B] { self => */ override def - (key: A): Map[A, B] = { val b = newBuilder - for (kv <- this.seq ; if kv._1 != key) b += kv + for (kv <- this ; if kv._1 != key) b += kv b.result() } } diff --git a/src/library/scala/collection/mutable/ArrayStack.scala b/src/library/scala/collection/mutable/ArrayStack.scala index e05d668519..fec2da8839 100644 --- a/src/library/scala/collection/mutable/ArrayStack.scala +++ b/src/library/scala/collection/mutable/ArrayStack.scala @@ -157,7 +157,7 @@ extends AbstractSeq[T] * @param xs The source of elements to push. * @return A reference to this stack. */ - override def ++=(xs: TraversableOnce[T]): this.type = { xs.seq foreach += ; this } + override def ++=(xs: TraversableOnce[T]): this.type = { xs foreach += ; this } /** Does the same as `push`, but returns the updated stack. * diff --git a/src/library/scala/collection/mutable/Stack.scala b/src/library/scala/collection/mutable/Stack.scala index 34c6d1fbb9..53b6c59939 100644 --- a/src/library/scala/collection/mutable/Stack.scala +++ b/src/library/scala/collection/mutable/Stack.scala @@ -119,7 +119,7 @@ extends AbstractSeq[A] * @param xs the traversable object. * @return the stack with the new elements on top. */ - def pushAll(xs: TraversableOnce[A]): this.type = { xs.seq foreach push ; this } + def pushAll(xs: TraversableOnce[A]): this.type = { xs foreach push ; this } /** Returns the top element of the stack. This method will not remove * the element from the stack. An error is signaled if there is no diff --git a/src/library/scala/collection/parallel/ParIterableLike.scala b/src/library/scala/collection/parallel/ParIterableLike.scala index 332d132ad0..5ec0238c69 100644 --- a/src/library/scala/collection/parallel/ParIterableLike.scala +++ b/src/library/scala/collection/parallel/ParIterableLike.scala @@ -416,8 +416,8 @@ self: ParIterableLike[T, Repr, Sequential] => * may be invoked arbitrary number of times. * * For example, one might want to process some elements and then produce a `Set`. In this - * case, `seqop` would process an element and append it to the list, while `combop` - * would concatenate two lists from different partitions together. The initial value + * case, `seqop` would process an element and append it to the set, while `combop` + * would concatenate two sets from different partitions together. The initial value * `z` would be an empty set. * * {{{ |