Skip to content

Commit 15df28f

Browse files
committed
Merge pull request scala#4677 from qilab-/ticket-9426
SI-9426 Rename the argument f of LinearSeqOptimized.foldLeft/foldRight to op
2 parents 2fe5159 + 38d2546 commit 15df28f

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/library/scala/collection/LinearSeqOptimized.scala

+6-6
Original file line numberDiff line numberDiff line change
@@ -117,25 +117,25 @@ trait LinearSeqOptimized[+A, +Repr <: LinearSeqOptimized[A, Repr]] extends Linea
117117
}
118118

119119
override /*TraversableLike*/
120-
def foldLeft[B](z: B)(f: (B, A) => B): B = {
120+
def foldLeft[B](z: B)(@deprecatedName('f) op: (B, A) => B): B = {
121121
var acc = z
122122
var these = this
123123
while (!these.isEmpty) {
124-
acc = f(acc, these.head)
124+
acc = op(acc, these.head)
125125
these = these.tail
126126
}
127127
acc
128128
}
129129

130130
override /*IterableLike*/
131-
def foldRight[B](z: B)(f: (A, B) => B): B =
131+
def foldRight[B](z: B)(@deprecatedName('f) op: (A, B) => B): B =
132132
if (this.isEmpty) z
133-
else f(head, tail.foldRight(z)(f))
133+
else op(head, tail.foldRight(z)(op))
134134

135135
override /*TraversableLike*/
136-
def reduceLeft[B >: A](f: (B, A) => B): B =
136+
def reduceLeft[B >: A](@deprecatedName('f) op: (B, A) => B): B =
137137
if (isEmpty) throw new UnsupportedOperationException("empty.reduceLeft")
138-
else tail.foldLeft[B](head)(f)
138+
else tail.foldLeft[B](head)(op)
139139

140140
override /*IterableLike*/
141141
def reduceRight[B >: A](op: (A, B) => B): B =

0 commit comments

Comments
 (0)