diff options
author | Seth Tisue <seth@tisue.net> | 2015-08-06 15:09:22 -0700 |
---|---|---|
committer | Seth Tisue <seth@tisue.net> | 2015-08-06 15:09:22 -0700 |
commit | 15df28ffe1ff45ac3b91792093bf178c09899c8f (patch) | |
tree | b5d432bc1d88fc7882aebbf828105bd1d517ea84 | |
parent | 2fe5159ad6b4c672db5f967cebe9d1ac98dede9f (diff) | |
parent | 38d2546120cbcda9a03759515c0ff4145fc188a8 (diff) | |
download | scala-15df28ffe1ff45ac3b91792093bf178c09899c8f.tar.gz scala-15df28ffe1ff45ac3b91792093bf178c09899c8f.tar.bz2 scala-15df28ffe1ff45ac3b91792093bf178c09899c8f.zip |
Merge pull request #4677 from qilab-/ticket-9426
SI-9426 Rename the argument f of LinearSeqOptimized.foldLeft/foldRight to op
-rwxr-xr-x | src/library/scala/collection/LinearSeqOptimized.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/library/scala/collection/LinearSeqOptimized.scala b/src/library/scala/collection/LinearSeqOptimized.scala index 9c336e8e31..571d58a3f3 100755 --- a/src/library/scala/collection/LinearSeqOptimized.scala +++ b/src/library/scala/collection/LinearSeqOptimized.scala @@ -117,25 +117,25 @@ trait LinearSeqOptimized[+A, +Repr <: LinearSeqOptimized[A, Repr]] extends Linea } override /*TraversableLike*/ - def foldLeft[B](z: B)(f: (B, A) => B): B = { + def foldLeft[B](z: B)(@deprecatedName('f) op: (B, A) => B): B = { var acc = z var these = this while (!these.isEmpty) { - acc = f(acc, these.head) + acc = op(acc, these.head) these = these.tail } acc } override /*IterableLike*/ - def foldRight[B](z: B)(f: (A, B) => B): B = + def foldRight[B](z: B)(@deprecatedName('f) op: (A, B) => B): B = if (this.isEmpty) z - else f(head, tail.foldRight(z)(f)) + else op(head, tail.foldRight(z)(op)) override /*TraversableLike*/ - def reduceLeft[B >: A](f: (B, A) => B): B = + def reduceLeft[B >: A](@deprecatedName('f) op: (B, A) => B): B = if (isEmpty) throw new UnsupportedOperationException("empty.reduceLeft") - else tail.foldLeft[B](head)(f) + else tail.foldLeft[B](head)(op) override /*IterableLike*/ def reduceRight[B >: A](op: (A, B) => B): B = |