We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c59b8d0 commit 6926796Copy full SHA for 6926796
compiler/src/dotty/tools/dotc/core/Decorators.scala
@@ -112,15 +112,12 @@ object Decorators {
112
else x1 :: xs1
113
}
114
115
- def foldRightBN[U](z: => U)(op: (T, => U) => U): U =
116
- xs.reverse.foldLeftBN(z)(op)
117
-
118
- final def foldLeftBN[U](acc: => U)(op: (T, => U) => U): U = {
119
- @tailrec def fold(xs: List[T], acc: => U): U = xs match {
120
- case x :: xs1 => fold(xs1, op(x, acc))
+ def foldRightBN[U](z: => U)(op: (T, => U) => U): U = {
+ @tailrec def foldLeftBN(xs: List[T], acc: => U): U = xs match {
+ case x :: xs1 => foldLeftBN(xs1, op(x, acc))
121
case Nil => acc
122
123
- fold(xs, acc)
+ foldLeftBN(xs.reverse, z)
124
125
126
final def hasSameLengthAs[U](ys: List[U]): Boolean = {
0 commit comments