summaryrefslogtreecommitdiff
path: root/src/library/scala/collection/SeqLike.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/library/scala/collection/SeqLike.scala')
-rw-r--r--src/library/scala/collection/SeqLike.scala10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/library/scala/collection/SeqLike.scala b/src/library/scala/collection/SeqLike.scala
index a1749a480b..33b6ab4165 100644
--- a/src/library/scala/collection/SeqLike.scala
+++ b/src/library/scala/collection/SeqLike.scala
@@ -103,7 +103,7 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[
def segmentLength(p: A => Boolean, from: Int): Int = {
var i = 0
- var it = iterator.drop(from)
+ val it = iterator.drop(from)
while (it.hasNext && p(it.next()))
i += 1
i
@@ -111,7 +111,7 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[
def indexWhere(p: A => Boolean, from: Int): Int = {
var i = from
- var it = iterator.drop(from)
+ val it = iterator.drop(from)
while (it.hasNext) {
if (p(it.next())) return i
else i += 1
@@ -177,10 +177,10 @@ trait SeqLike[+A, +Repr] extends Any with IterableLike[A, Repr] with GenSeqLike[
result
}
private def swap(i: Int, j: Int) {
- var tmpI = idxs(i)
+ val tmpI = idxs(i)
idxs(i) = idxs(j)
idxs(j) = tmpI
- var tmpE = elms(i)
+ val tmpE = elms(i)
elms(i) = elms(j)
elms(j) = tmpE
}
@@ -777,7 +777,7 @@ object SeqLike {
val iter = S.iterator.drop(m0)
val Wopt = kmpOptimizeWord(W, n0, n1, true)
val T = kmpJumpTable(Wopt, n1-n0)
- var cache = new Array[AnyRef](n1-n0) // Ring buffer--need a quick way to do a look-behind
+ val cache = new Array[AnyRef](n1-n0) // Ring buffer--need a quick way to do a look-behind
var largest = 0
var i, m = 0
var answer = -1